当前位置: 首页>>代码示例>>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;未经允许,请勿转载。