當前位置: 首頁>>代碼示例>>Java>>正文


Java Constants類代碼示例

本文整理匯總了Java中org.wisdom.maven.Constants的典型用法代碼示例。如果您正苦於以下問題:Java Constants類的具體用法?Java Constants怎麽用?Java Constants使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Constants類屬於org.wisdom.maven包,在下文中一共展示了Constants類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getArchive

import org.wisdom.maven.Constants; //導入依賴的package包/類
private static File getArchive(AbstractWisdomMojo mojo, String profileOrGAV) throws MojoExecutionException {
    if (profileOrGAV == null  || "regular".equalsIgnoreCase(profileOrGAV)) {
        return DependencyFinder.resolve(mojo, mojo.plugin.getGroupId(),
                Constants.WISDOM_RUNTIME_ARTIFACT_ID, mojo.plugin.getVersion(),
                "zip", null);
    }

    if ("base".equalsIgnoreCase(profileOrGAV)) {
        return DependencyFinder.resolve(mojo, mojo.plugin.getGroupId(),
                Constants.WISDOM_BASE_RUNTIME_ARTIFACT_ID, mojo.plugin.getVersion(),
                "zip", null);
    }

    if ("equinox".equalsIgnoreCase(profileOrGAV)) {
        return DependencyFinder.resolve(mojo, mojo.plugin.getGroupId(),
                Constants.WISDOM_RUNTIME_ARTIFACT_ID, mojo.plugin.getVersion(),
                "zip", "equinox");
    }

    // It's a GAV.
    return DependencyFinder.resolve(mojo, profileOrGAV);
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:23,代碼來源:WisdomRuntimeExpander.java

示例2: copyConfiguration

import org.wisdom.maven.Constants; //導入依賴的package包/類
/**
 * Copies the configuration from "src/main/configuration" to "wisdom/conf". Copied resources are filtered.
 *
 * @param mojo      the mojo
 * @param filtering the component required to filter resources
 * @throws IOException if a file cannot be copied
 */
public static void copyConfiguration(AbstractWisdomWatcherMojo mojo, MavenResourcesFiltering filtering) throws
        IOException {
    File in = new File(mojo.basedir, Constants.CONFIGURATION_SRC_DIR);
    if (in.isDirectory()) {
        File out = new File(mojo.getWisdomRootDirectory(), Constants.CONFIGURATION_DIR);
        filterAndCopy(mojo, filtering, in, out);
    } else {
        mojo.getLog().warn("No configuration directory (src/main/configuration) - use this mode at your own risk");
        mojo.getLog().warn("A fake application configuration is going to be created, " +
                "using a fake application secret, do not use this file in production");
        // No configuration directory, generate a fake application configuration
        File conf = new File(mojo.getWisdomRootDirectory(), "conf");
        mojo.getLog().debug("Creating conf directory " + conf.mkdirs());
        File output = new File(conf, "application.conf");
        ApplicationSecretGenerator.generateFakeConfiguration(output);
    }
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:25,代碼來源:ResourceCopy.java

示例3: copyDefaultErrorTemplates

import org.wisdom.maven.Constants; //導入依賴的package包/類
private void copyDefaultErrorTemplates() throws IOException {
    File templateDirectory = new File(root, Constants.TEMPLATES_SRC_DIR);
    File error = new File(templateDirectory, "error");
    if (error.mkdirs()) {
        getLog().debug(error.getAbsolutePath() + " directory created");
    }

    // Copy 404
    InputStream is = CreateMojo.class.getClassLoader().getResourceAsStream("templates/error/404.thl.html");
    FileUtils.copyInputStreamToFile(is, new File(error, "404.thl.html"));
    IOUtils.closeQuietly(is);

    // Copy 500
    is = CreateMojo.class.getClassLoader().getResourceAsStream("templates/error/500.thl.html");
    FileUtils.copyInputStreamToFile(is, new File(error, "500.thl.html"));
    IOUtils.closeQuietly(is);

    // Copy pipeline
    is = CreateMojo.class.getClassLoader().getResourceAsStream("templates/error/pipeline.thl.html");
    FileUtils.copyInputStreamToFile(is, new File(error, "pipeline.thl.html"));
    IOUtils.closeQuietly(is);
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:23,代碼來源:CreateMojo.java

示例4: testDumpEmptyDependencies

import org.wisdom.maven.Constants; //導入依賴的package包/類
@Test
public void testDumpEmptyDependencies() throws Exception {
    Model model = new Model();
    model.setPomFile(new File("target/test-classes/maven/test/minimal.xml"));
    MavenProject project = new MavenProject(model);
    project.setFile(new File("target/test-classes/maven/test/minimal.xml"));

    Classpath.store(project);

    File deps = new File(project.getBasedir(), Constants.DEPENDENCIES_FILE);
    assertThat(deps).isFile();
    ObjectMapper mapper = new ObjectMapper();
    ProjectDependencies dependencies = mapper.readValue(deps, ProjectDependencies.class);
    System.out.println(dependencies.getDirectDependencies());

    assertThat(Classpath.load(project.getBasedir()).getDirectDependencies()).isEmpty();
    assertThat(Classpath.load(project.getBasedir()).getTransitiveDependencies()).isEmpty();
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:19,代碼來源:MavenUtilsTest.java

示例5: copyExternalAssets

import org.wisdom.maven.Constants; //導入依賴的package包/類
/**
 * Copies the external assets from "src/main/assets" to "wisdom/assets". Copied resources are filtered.
 *
 * @param mojo      the mojo
 * @param filtering the component required to filter resources
 * @throws IOException if a file cannot be copied
 */
public static void copyExternalAssets(AbstractWisdomMojo mojo, MavenResourcesFiltering filtering) throws IOException {
    File in = new File(mojo.basedir, Constants.ASSETS_SRC_DIR);
    if (!in.exists()) {
        return;
    }
    File out = new File(mojo.getWisdomRootDirectory(), Constants.ASSETS_DIR);
    filterAndCopy(mojo, filtering, in, out);
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:16,代碼來源:ResourceCopy.java

示例6: copyTemplates

import org.wisdom.maven.Constants; //導入依賴的package包/類
/**
 * Copies the external templates from "src/main/templates" to "wisdom/templates". Copied resources are filtered.
 *
 * @param mojo      the mojo
 * @param filtering the component required to filter resources
 * @throws IOException if a file cannot be copied
 */
public static void copyTemplates(AbstractWisdomMojo mojo, MavenResourcesFiltering filtering) throws IOException {
    File in = new File(mojo.basedir, Constants.TEMPLATES_SRC_DIR);
    if (!in.exists()) {
        return;
    }
    File out = new File(mojo.getWisdomRootDirectory(), Constants.TEMPLATES_DIR);

    filterAndCopy(mojo, filtering, in, out);
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:17,代碼來源:ResourceCopy.java

示例7: copyInternalResources

import org.wisdom.maven.Constants; //導入依賴的package包/類
/**
 * Copies the internal resources from "src/main/resources" to "target/classes". Copied resources are filtered.
 * Notice that these resources are embedded in the application's bundle.
 *
 * @param mojo      the mojo
 * @param filtering the component required to filter resources
 * @throws IOException if a file cannot be copied
 */
public static void copyInternalResources(AbstractWisdomMojo mojo, MavenResourcesFiltering filtering) throws
        IOException {
    File in = new File(mojo.basedir, Constants.MAIN_RESOURCES_DIR);
    if (!in.exists()) {
        return;
    }
    File out = new File(mojo.buildDirectory, "classes");
    filterAndCopy(mojo, filtering, in, out);
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:18,代碼來源:ResourceCopy.java

示例8: copyInstances

import org.wisdom.maven.Constants; //導入依賴的package包/類
/**
 * Copies the `cfg` files from `src/main/instances` to the Wisdom application directory.
 *
 * @param mojo      the mojo
 * @param filtering the filtering support
 * @throws IOException if file cannot be copied
 */
public static void copyInstances(AbstractWisdomMojo mojo, MavenResourcesFiltering filtering) throws IOException {
    File in = new File(mojo.basedir, Constants.INSTANCES_SRC_DIR);
    if (in.isDirectory()) {
        File out = new File(mojo.getWisdomRootDirectory(), Constants.APPLICATION_DIR);
        filterAndCopy(mojo, filtering, in, out);
    }
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:15,代碼來源:ResourceCopy.java

示例9: store

import org.wisdom.maven.Constants; //導入依賴的package包/類
/**
 * Stores the dependencies from the given project into the 'dependencies.json' file.
 *
 * @param project the project
 * @throws IOException if the file cannot be created.
 */
public static void store(MavenProject project) throws IOException {
    final File output = new File(project.getBasedir(), Constants.DEPENDENCIES_FILE);
    output.getParentFile().mkdirs();
    ProjectDependencies dependencies = new ProjectDependencies(project);
    mapper.writer()
            .withDefaultPrettyPrinter()
            .writeValue(
                    output,
                    dependencies
            );
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:18,代碼來源:Classpath.java

示例10: getWisdomRootDirectory

import org.wisdom.maven.Constants; //導入依賴的package包/類
/**
 * Gets the root directory of the Wisdom server. Generally it's 'target/wisdom' except if the
 * {@link #wisdomDirectory} parameter is configured. In this case,
 * it returns the location specified by this parameter.
 *
 * @return the Wisdom's root.
 */
public File getWisdomRootDirectory() {
    File wisdom;
    if (wisdomDirectory == null) {
        wisdom = new File(buildDirectory, Constants.WISDOM_DIRECTORY_NAME);
    } else {
        this.getLog().debug("Using Wisdom Directory : " + wisdomDirectory.getAbsolutePath());
        wisdom = wisdomDirectory;
    }

    if (wisdom.mkdirs()) {
        this.getLog().debug(wisdom.getAbsolutePath() + " directory created.");
    }
    return wisdom;
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:22,代碼來源:AbstractWisdomMojo.java

示例11: getNodeDistributionRootUrl

import org.wisdom.maven.Constants; //導入依賴的package包/類
/**
 * Gets the root url where the node distribution is downloaded from. Default value is 'http://nodejs.org/dist/' except if the
 * {@link #nodeDistributionUrl} parameter is configured. In this case,
 * it returns the url specified by this parameter.
 *
 * @return the root url used to download the node distribution.
 */
public String getNodeDistributionRootUrl() {
    String ret = nodeDistributionRootUrl;
    if (nodeDistributionRootUrl == null) {
        ret = Constants.NODE_DIST_ROOT_URL;
    }

    return ret;
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:16,代碼來源:AbstractWisdomMojo.java

示例12: getNpmRegistryRootUrl

import org.wisdom.maven.Constants; //導入依賴的package包/類
/**
 * Gets the root url of the npm registry. Default value is 'https://registry.npmjs.org/' except if the
 * {@link #npmRegistryRootUrl} parameter is configured. In this case,
 * it returns the url specified by this parameter.
 *
 * @return the root url of the npm registry.
 */
public String getNpmRegistryRootUrl() {
    if (npmRegistryRootUrl == null) {
        return Constants.NPM_REGISTRY_ROOT_URL;
    } else {
        return npmRegistryRootUrl;
    }
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:15,代碼來源:AbstractWisdomMojo.java

示例13: getNodeVersion

import org.wisdom.maven.Constants; //導入依賴的package包/類
public String getNodeVersion() {
    if (nodeVersion == null) {
        return Constants.NODE_VERSION;
    } else {
        if (nodeVersion.startsWith("v")) {
            return nodeVersion;
        } else {
            return "v" + nodeVersion;
        }
    }
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:12,代碼來源:AbstractWisdomMojo.java

示例14: getNPMVersion

import org.wisdom.maven.Constants; //導入依賴的package包/類
public String getNPMVersion() {
    if (npmVersion == null) {
        return Constants.NPM_VERSION;
    } else {
        return nodeVersion;
    }
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:8,代碼來源:AbstractWisdomMojo.java

示例15: write

import org.wisdom.maven.Constants; //導入依賴的package包/類
private void write(Properties properties) throws IOException {
    File file = new File(project.getBasedir(), Constants.OSGI_PROPERTIES);
    file.getParentFile().mkdirs();
    FileOutputStream fos = null;
    try {
        fos = new FileOutputStream(file);
        properties.store(fos, "");
    } finally {
        IOUtils.closeQuietly(fos);
    }
}
 
開發者ID:wisdom-framework,項目名稱:wisdom,代碼行數:12,代碼來源:InitializeMojo.java


注:本文中的org.wisdom.maven.Constants類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。