Examples of MavenArtifact


Examples of com.crsn.maven.utils.osgirepo.maven.MavenArtifact

      this.organization = organization;
    }

    @Override
    public void build() {
      artefacts.add( new MavenArtifact( group,
                                        artifactId,
                                        version,
                                        dependencies,
                                        content,
                                        name,
View Full Code Here

Examples of net.flexmojos.oss.plugin.compiler.attributes.MavenArtifact

            extensions[i] = new IExtension()
            {
                public File extension()
                {
                    MavenArtifact a = extension.getExtensionArtifact();
                    Artifact resolvedArtifact =
                        resolve( a.getGroupId(), a.getArtifactId(), a.getVersion(), a.getClassifier(), a.getType() );
                    return resolvedArtifact.getFile();
                }

                public String[] parameters()
                {
View Full Code Here

Examples of net.sf.minuteProject.loader.catalog.databasecatalog.node.MavenArtifact

  }
 

  private Driver getDriverMaven() {
    Driver driver = new Driver();
    MavenArtifact mavenArtifact = getChoosenDatabase().getMavenArtifact();
    driver.setArtifactId(mavenArtifact.getMvnArtifactId());
    driver.setGroupId(mavenArtifact.getMvnGroupId());
    driver.setVersion(mavenArtifact.getMvnVersion());
    return driver;
  }
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

            final NumberFormat doubleFormat = NumberFormat.getInstance(Locale.US);
            doubleFormat.setMinimumFractionDigits(1);
            doubleFormat.setMaximumFractionDigits(1);
            final String version = doubleFormat.format(playerVersion);

            final MavenArtifact playerArtifact = new MavenArtifact();
            playerArtifact.setGroupId("com.adobe.flash");
            playerArtifact.setArtifactId("runtime");
            playerArtifact.setVersion(version);
            playerArtifact.setPackaging("exe");

            // Deploy Windows binaries.
            final File windowsDirectory = new File(versionDir, "win");
            if(windowsDirectory.exists()) {
                // Find out if a flash-player binary exists.
                File flashPlayerBinary = null;
                if(new File(windowsDirectory, "FlashPlayerDebugger.exe").exists()) {
                    flashPlayerBinary = new File(windowsDirectory, "FlashPlayerDebugger.exe");
                } else if(new File(windowsDirectory, "FlashPlayer.exe").exists()) {
                    flashPlayerBinary = new File(windowsDirectory, "FlashPlayer.exe");
                }

                // If a binary exists, copy it to the target and create a pom for it.
                if (flashPlayerBinary != null) {
                    playerArtifact.addBinaryArtifact("win", flashPlayerBinary);
                }
            }

            // Deploy Mac binaries.
            final File macDirectory = new File(versionDir, "mac");
            if(macDirectory.exists()) {
                // Find out if a flash-player binary exists.
                File flashPlayerBinary = null;
                if(new File(macDirectory, "Flash Player.app.zip").exists()) {
                    flashPlayerBinary = new File(macDirectory, "Flash Player.app.zip");
                } else if(new File(macDirectory, "Flash Player Debugger.app.zip").exists()) {
                    flashPlayerBinary = new File(macDirectory, "Flash Player Debugger.app.zip");
                }

                // If a binary exists, copy it to the target and create a pom for it.
                if (flashPlayerBinary != null) {
                    playerArtifact.addBinaryArtifact("mac", flashPlayerBinary);
                }
            }

            // Deploy Linux binaries.
            final File lnxDirectory = new File(versionDir, "lnx");
            if(lnxDirectory.exists()) {
                // Find out if a flash-player binary exists.
                File flashPlayerBinary;
                if(new File(lnxDirectory, "flashplayer.tar.gz").exists()) {
                    flashPlayerBinary = new File(lnxDirectory, "flashplayer.tar.gz");
                } else if(new File(lnxDirectory, "flashplayerdebugger.tar.gz").exists()) {
                    flashPlayerBinary = new File(lnxDirectory, "flashplayerdebugger.tar.gz");
                } else {
                    throw new ConverterException("Couldn't find player archive.");
                }

                // Decompress the archive.
                // First unzip it.
                final FileInputStream fin;
                try {
                    fin = new FileInputStream(flashPlayerBinary);
                    final BufferedInputStream in = new BufferedInputStream(fin);
                    final File tempTarFile = File.createTempFile("flex-sdk-linux-flashplayer-binary-" + version, ".tar");
                    final FileOutputStream out = new FileOutputStream(tempTarFile);
                    final GzipCompressorInputStream gzIn = new GzipCompressorInputStream(in);
                    final byte[] buffer = new byte[1024];
                    int n;
                    while (-1 != (n = gzIn.read(buffer))) {
                        out.write(buffer, 0, n);
                    }
                    out.close();
                    gzIn.close();

                    // Then untar it.
                    File uncompressedBinary = null;
                    final FileInputStream tarFileInputStream = new FileInputStream(tempTarFile);
                    final TarArchiveInputStream tarArchiveInputStream = new TarArchiveInputStream(tarFileInputStream);
                    ArchiveEntry entry;
                    while((entry = tarArchiveInputStream.getNextEntry()) != null) {
                        if("flashplayer".equals(entry.getName())) {
                            uncompressedBinary = File.createTempFile("flex-sdk-linux-flashplayer-binary-" + version, ".uexe");
                            final FileOutputStream uncompressedBinaryOutputStream = new FileOutputStream(uncompressedBinary);
                            while(-1 != (n = tarArchiveInputStream.read(buffer))) {
                                uncompressedBinaryOutputStream.write(buffer, 0, n);
                            }
                            uncompressedBinaryOutputStream.close();
                        } else if("flashplayerdebugger".equals(entry.getName())) {
                            uncompressedBinary = File.createTempFile("flex-sdk-linux-flashplayer-binary-" + version, ".uexe");
                            final FileOutputStream uncompressedBinaryOutputStream = new FileOutputStream(uncompressedBinary);
                            while(-1 != (n = tarArchiveInputStream.read(buffer))) {
                                uncompressedBinaryOutputStream.write(buffer, 0, n);
                            }
                            uncompressedBinaryOutputStream.close();
                        }
                    }
                    tarFileInputStream.close();

                    // If a binary exists, copy it to the target and create a pom for it.
                    if (uncompressedBinary != null) {
                        playerArtifact.addBinaryArtifact("linux", flashPlayerBinary);
                    }
                } catch (FileNotFoundException e) {
                    throw new ConverterException("Error processing the linux player tar file", e);
                } catch (IOException e) {
                    throw new ConverterException("Error processing the linux player tar file", e);
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

                doubleFormat.setMinimumFractionDigits(1);
                doubleFormat.setMaximumFractionDigits(1);
                final String version = doubleFormat.format(playerVersion);

                // Create an artifact for the player-global.
                final MavenArtifact playerglobal = new MavenArtifact();
                playerglobal.setGroupId("com.adobe.flash.framework");
                playerglobal.setArtifactId("playerglobal");
                playerglobal.setVersion(version);
                playerglobal.setPackaging("swc");
                playerglobal.addDefaultBinaryArtifact(playerglobalSwc);
                writeArtifact(playerglobal);
            }
        }
    }
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

            }
            else if(numFound == 1) {
                final JSONArray docs = (JSONArray) responseObject.get("docs");
                final JSONObject firstHit = (JSONObject) docs.get(0);

                final MavenArtifact artifactMetadata = new MavenArtifact();
                artifactMetadata.setGroupId((String) firstHit.get("g"));
                artifactMetadata.setArtifactId((String) firstHit.get("a"));
                artifactMetadata.setVersion((String) firstHit.get("v"));
                artifactMetadata.setPackaging((String) firstHit.get("p"));

                return artifactMetadata;
            } else {
                long newestTimestamp = 0;
                JSONObject newestVersion = null;

                JSONArray options = (JSONArray) responseObject.get("docs");
                // if the "groupId" is "batik" then use the newer version.
                for(int i = 0; i < numFound; i++) {
                    final JSONObject option = (JSONObject) options.get(0);
                    if("batik".equals(option.get("g")) && "batik-dom".equals(option.get("a")) && "jar".equals(option.get("p"))) {
                        final long timestamp = (Long) option.get("timestamp");
                        if(timestamp > newestTimestamp) {
                            newestTimestamp = timestamp;
                            newestVersion = option;
                        }
                    }
                }

                if(newestVersion != null) {
                    final MavenArtifact artifactMetadata = new MavenArtifact();
                    artifactMetadata.setGroupId((String) newestVersion.get("g"));
                    artifactMetadata.setArtifactId((String) newestVersion.get("a"));
                    artifactMetadata.setVersion((String) newestVersion.get("v"));
                    artifactMetadata.setPackaging((String) newestVersion.get("p"));

                    return artifactMetadata;
                } else {
                    System.out.println("For jar-file with checksum: " + checksum +
                            " more than one result was returned by query: " + queryUrl);
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

        // fdk generated after this one uses the same version of a lib, the version of the older fdk is
        // used also reducing the amount of jars that have to be re-deployed.
        final String checksum = calculateChecksum(sourceFile);

        // Try to get artifact metadata based upon the checksum by looking up the internal cache.
        MavenArtifact artifact =  checksums.get(checksum);

        // Reusing artifact from other sdk version.
        if(artifact != null) {
            System.out.println("Reusing artifact (" + checksum + ") : " + artifact.getGroupId() + ":" +
                    artifact.getArtifactId() + ":" + artifact.getVersion());
            return artifact;
        }
        // Id no artifact was found in the local cache, continue processing.
        else {
            // Do a lookup in maven central.
            artifact = lookupMetadataForChecksum(checksum);

            // The file was available on maven central, so use that version instead of the one coming with the sdk.
            if(artifact != null) {
                System.out.println("Using artifact from Maven Central (" + checksum + ") : " +
                        artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion());
            }
            // The file was not available on maven central, so we have to add it manually.
            else {
                // The artifact name is the name of the jar.
                final String artifactFileName = sourceFile.getName();
                final String dependencyArtifactId = artifactFileName.substring(0, artifactFileName.lastIndexOf("."));
                final String dependencyArtifactPackaging =
                        artifactFileName.substring(artifactFileName.lastIndexOf(".") + 1);

                // Generate a new metadata object
                artifact = new MavenArtifact();
                artifact.setGroupId(defaultGroupId);
                artifact.setArtifactId(dependencyArtifactId);
                artifact.setVersion(defaultVersion);
                artifact.setPackaging(dependencyArtifactPackaging);
                artifact.addDefaultBinaryArtifact(sourceFile);

                // Create the pom document that will reside next to the artifact lib.
                writeArtifact(artifact);
            }
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

     *
     * @throws ConverterException
     */
    protected void generateRuntimeArtifacts() throws ConverterException {
        // Create the root artifact.
        final MavenArtifact runtime = new MavenArtifact();
        runtime.setGroupId("com.adobe.air");
        runtime.setArtifactId("runtime");
        runtime.setVersion(airSdkVersion);
        runtime.setPackaging("pom");

        // Create a list of all libs that should belong to the AIR SDK runtime.
        final File directory = new File(rootSourceDirectory, "bin");
        if(!directory.exists() || !directory.isDirectory()) {
            throw new ConverterException("Runtime directory does not exist.");
        }
        final List<File> files = new ArrayList<File>();
        files.addAll(Arrays.asList(directory.listFiles(new AirRuntimeFilter())));

        // Generate artifacts for every jar in the input directories (Actually this is only one file).
        for(final File sourceFile : files) {
            final MavenArtifact artifact = resolveArtifact(sourceFile, "com.adobe.air.runtime", airSdkVersion);
            runtime.addDependency(artifact);
        }

        // Zip up the AIR runtime directory.
        final MavenArtifact airRuntimeArtifact = generateAirRuntimeArtifact(rootSourceDirectory);
        if(airRuntimeArtifact != null) {
            runtime.addDependency(airRuntimeArtifact);
        }

        // Write this artifact to file.
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

     *
     * @throws ConverterException
     */
    protected void generateFrameworkArtifacts() throws ConverterException {
        // Create the root artifact.
        final MavenArtifact framework = new MavenArtifact();
        framework.setGroupId("com.adobe.air");
        framework.setArtifactId("framework");
        framework.setVersion(airSdkVersion);
        framework.setPackaging("pom");

        // Create a list of all libs that should belong to the AIR SDK framework.
        final File directory =
                new File(rootSourceDirectory, "frameworks" + File.separator + "libs" + File.separator + "air");
        if(!directory.exists() || !directory.isDirectory()) {
            throw new ConverterException("Framework directory does not exist.");
        }
        final List<File> files = new ArrayList<File>();
        files.addAll(Arrays.asList(directory.listFiles(new AirFrameworkFilter())));

        // Generate artifacts for every jar in the input directories.
        for(final File sourceFile : files) {
            final MavenArtifact artifact = resolveArtifact(sourceFile, "com.adobe.air.framework", airSdkVersion);
            framework.addDependency(artifact);
        }

        // Write this artifact to file.
        writeArtifact(framework);
View Full Code Here

Examples of org.apache.flex.utilities.converter.model.MavenArtifact

    //   Utility methods
    //
    ///////////////////////////////////////////////////////////////////////////////////////////////////

    protected MavenArtifact generateAirRuntimeArtifact(File rootDirectory) throws ConverterException {
        final MavenArtifact airRuntimeArtifact = new MavenArtifact();
        airRuntimeArtifact.setGroupId("com.adobe.air.runtime");
        airRuntimeArtifact.setArtifactId("air-runtime");
        airRuntimeArtifact.setVersion(airSdkVersion);
        airRuntimeArtifact.setPackaging("zip");

        final File runtimeRoot = new File(rootDirectory, "runtimes.air".replace(".", File.separator));
        final File[] platforms = runtimeRoot.listFiles();
        if(platforms != null) {
            for (final File platform : platforms) {
                if (!platform.isDirectory()) {
                   continue;
                }
                final String platformName = platform.getName();
                try {
                   final File zip = File.createTempFile("AirRuntime-" + platformName + "-" + airSdkVersion, "zip");
                   generateZip(platform.listFiles(), zip);
                   airRuntimeArtifact.addBinaryArtifact(platformName, zip);
                } catch (IOException e) {
                   throw new ConverterException("Error creating runtime zip.", e);
                }
            }
        } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.