我的项目包含一个jar文件,因为它被列为传递依赖项.
但是,我不仅验证了我不需要它,但它会导致问题,因为jar文件中的类会影响我在另一个jar文件中需要的类.
如何从传递依赖中遗漏一个jar文件?
我有一个Maven项目,有3个模块.这些是由父母建造的pom.xml
我现在要求我需要pom.xml根据所选的配置文件从其中一个子模块的文件中运行一个插件.
如何指定此插件只应在构建中使用某个配置文件时运行?
我在我的pom中添加了下面的描述
<dependency>
<artifactId>richfaces-api</artifactId>
<groupId>org.richfaces.framework</groupId>
<version>3.3.3.Final</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
<version>3.3.3.Final</version>
</dependency>
<dependency>
<artifactId>richfaces-impl</artifactId>
<groupId>org.richfaces.framework</groupId>
<version>3.3.3.Final</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
当我在命令提示符下执行mvn clean install时,会下载这些依赖项jar.但是在Eclipse中,这并未显示在引用的库部分下.尽管如此,其他jar文件仍然是依赖项的一部分.我必须做些什么来反映这一点吗?谢谢.
我需要更新一个可观察的数组元素值.可观察数组是类对象的集合.首先,我需要通过id找出匹配的对象,并更新对象的一些其他属性值.
var Seat = function(no, booked) {
var self = this;
self.No = ko.observable(no);
self.Booked = ko.observable(!!booked);
// Subscribe to the "Booked" property
self.Booked.subscribe(function() {
alert( self.No() );
});
};
var viewModel = {
seats: ko.observableArray( [
new Seat(1, false), new Seat(2, true), new Seat(3, true),
new Seat(4, false), new Seat(5, true), new Seat(6, true),
new Seat(7, false), new Seat(8, true), new Seat(9, true)
] )
};
Run Code Online (Sandbox Code Playgroud)
任何人都可以建议更新视图模型的方法吗?假设我想将2号座位的预订值更新为"假".
我使用curl使用公共证书文件从https站点下载数据.
系统信息:
命令是,
curl -v "https://<ip:<port>" --cert "./cert.pem" --cacert "./cacert.pem" --cert-type PEM
* About to connect() to kng.com port 443 (#0)
* Trying 11.19.37.123...
* Adding handle: conn: 0x8189e68
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x8189e68) send_pipe: 1, recv_pipe: 0
* Connected to fkng.com (11.19.37.123) port 443 (#0)
* unable to set private key file: './cert.pem' type PEM
* Closing …Run Code Online (Sandbox Code Playgroud) 所以看起来Maven包默认设置为编译但不复制java类路径中的xml文件,除非它们已经存在.在Eclipse中,我创建了最简单的测试,一个默认的spring mvc模板应用程序.java源代码中只有两个文件,一个java控制器和一个虚拟xml文件.pom是:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<name>abc</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.6</java-version>
<org.springframework-version>3.0.6.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.9</org.aspectj-version>
<org.slf4j-version>1.5.10</org.slf4j-version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency> …Run Code Online (Sandbox Code Playgroud) 我有脚本停止容器,然后删除它们
docker stop $(docker ps -q)
docker rm $(docker ps -a -q)
Run Code Online (Sandbox Code Playgroud)
但我不想删除名为"my_docker"的docker容器.
如何删除除此之外的所有容器?
我正在使用docker-compose来定义我的服务.在docker中,docker volume有两个概念.首先是关于bind mount:挂载主机存储.
docker run -d --name web-app -v $HOST/location:/container/location -p 80:80 httpd:latest
Run Code Online (Sandbox Code Playgroud)
其次是关于managed mount:抽象存储,不依赖于主机.
docker run -d --name web-app -v /container/location -p 80:80 httpd:latest
Run Code Online (Sandbox Code Playgroud)
我想将这些概念映射到docker-compose.这意味着我如何定义bind mount以及managed mount何时使用docker-compose.
刚开始使用Protractor进行E2E测试,我在测试用例结构上遇到了一些麻烦.
不确定我是否可以将我的测试划分为单独的规范,然后从另一个中调用它们,或者我如何制作好的辅助函数来处理它.
我正在通过转发器找到元素,然后我想对转发器中每个元素的每个操作进行测试.有点像:
describe('tasty', function () {
'use strict';
var ptor;
beforeEach(function () {
ptor = protractor.getInstance();
ptor.get('http://localhost:8000/');
});
it('Should sample three tasty fruits of every kind on my shopping list.', function () {
ptor.findElement(protractor.By.className('fruitstore')).click();
var fruitshelves = ptor.findElements(protractor.By.repeater('fruit in fruits').column('header'));
fruitshelves.then(function(arr) {
for (var i=0;i<arr.length; i++) {
// Pick up three fruits of this kind from the shelf and put in shopping cart
// Should be listed on my shopping list
// Open the wallet
// Should have money …Run Code Online (Sandbox Code Playgroud) 我返回一个带有URL的资源
$resource("http://foo.com/bar.json").get().
$promise.then(function(data){ $scope.result = data},
function(error){ $scope.msg = "error" } );
Run Code Online (Sandbox Code Playgroud)
资源回报
["item1"...."item_n",.....,"$promise", "$resolved", "$get", "$save", "$query", "$remove", "$delete"]
Run Code Online (Sandbox Code Playgroud)
为什么我在数据集中获取所有这些对象.我猜$ promise只返回所有这些并等待服务器响应.但是,一旦我有服务器响应,我可以在没有Promise行话的情况下获取我的服务器数据吗?
maven ×3
docker ×2
java ×2
javascript ×2
angularjs ×1
curl ×1
dependencies ×1
eclipse ×1
knockout.js ×1
m2e ×1
maven-2 ×1
openssl ×1
pom.xml ×1
profile ×1
protractor ×1
richfaces ×1