小编so1*_*345的帖子

在maven中配置不同文件类型的编码?

我使用maven-resource-plugin来过滤maven项目中的一些资源.在我的父项目中,我有:

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Run Code Online (Sandbox Code Playgroud)

在一个子项目中,我有一个test.properties文件,它是一个普通的java属性文件,默认编码= ISO-8859-1.该文件包含:

aboutText=Version ${project.version} © 2012 blabla
Run Code Online (Sandbox Code Playgroud)

为了确保正确过滤此文件,我将maven-resource-plugin拆分为单独的执行,每个执行都有其编码:

  <plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <configuration>
      <nonFilteredFileExtensions>
        <nonFilteredFileExtension>ico</nonFilteredFileExtension>
        <nonFilteredFileExtension>jar</nonFilteredFileExtension>
      </nonFilteredFileExtensions>
    </configuration>
    <executions>
      <execution>
        <id>filter-properties-files</id>
        <phase>generate-resources</phase>
        <goals>
          <goal>copy-resources</goal>
        </goals>
        <configuration>
          <!-- java properties files are encoded in ISO-8859-1 so when 
            filtering those files we stick with that encoding. -->
          <encoding>ISO-8859-1</encoding>
          <outputDirectory>${basedir}/after</outputDirectory>
          <resources>
            <resource>
              <filtering>true</filtering>
              <directory>${basedir}/before</directory>
              <includes>
                <include>**/*.properties</include>
              </includes>
            </resource>
          </resources>
        </configuration>
      </execution>
      <execution>
        <id>filter-non-properties-files</id>
        <phase>generate-resources</phase>
        <goals>
          <goal>copy-resources</goal>
        </goals>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
          <outputDirectory>${basedir}/after</outputDirectory>
          <resources>
            <resource>
              <filtering>true</filtering>
              <directory>${basedir}/before</directory>
              <includes>
                <include>**/*.product</include>
                <include>**/*.inf</include> …
Run Code Online (Sandbox Code Playgroud)

encoding maven

16
推荐指数
2
解决办法
4391
查看次数

警告:未找到PhantomJS

我已经在debian 6上安装了nodejs 0.10.15.使用npm然后我安装了:

sudo npm install grunt-cli -g
Run Code Online (Sandbox Code Playgroud)

我还在我的本地测试目录中执行了npm install(将必要的依赖项下载到node_modules目录),其中包含以下package.json文件:

{
  "name": "sample-name",
  "version": "1.4.0",
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-qunit": ">0.0.0",
    "grunt-qunit-istanbul": ">0.0.0"
  }
}
Run Code Online (Sandbox Code Playgroud)

这是安装phantomjs时的输出:

...
Writing location.js file
Done. Phantomjs binary available at /home/myuser/Test/node_modules/grunt-contrib-qunit/node_modules/grunt-lib-phantomjs/node_modules/phantomjs/lib/phantom/bin/phantomjs
Done. Phantomjs binary available at /home/myuser/Test/node_modules/grunt-qunit-istanbul/node_modules/grunt-lib-phantomjs-istanbul/node_modules/phantomjs/lib/phantom/bin/phantomjs
grunt@0.4.1 node_modules/grunt
??? which@1.0.5
...
Run Code Online (Sandbox Code Playgroud)

但是当我从测试目录运行grunt测试时,我得到:

Running PhantomJS...ERROR
>> In order for this task to work properly, PhantomJS must be installed locally
>> via NPM. If you're seeing this message, generally that means the NPM install …
Run Code Online (Sandbox Code Playgroud)

debian node.js phantomjs

14
推荐指数
2
解决办法
5万
查看次数

每当构建SNAPSHOT依赖项时构建 - 在Jenkins上Gradle

在Jenkins上构建maven项目时,可以指定构建触发器:

每当构建SNAPSHOT依赖项时构建

这开箱即用.

我有一个Gradle项目,我使用Artifactory作为我的二进制存储,在Jenkins(版本1.483)上使用gradle(v.1.2)构建.但找不到相同的选项.是否有任何用于Jenkins的Gradle插件可以启用此功能,还是可以在.gradle文件中全局配置它?

artifactory gradle jenkins

5
推荐指数
0
解决办法
1034
查看次数

标签 统计

artifactory ×1

debian ×1

encoding ×1

gradle ×1

jenkins ×1

maven ×1

node.js ×1

phantomjs ×1