据我所知,promise是可以解决()或拒绝()但我很惊讶发现在调用解析或拒绝后,promise中的代码继续执行.
我认为解决或拒绝是退出或返回的异步友好版本,这将停止所有立即执行功能.
有人可以解释为什么以下示例有时会在解析调用后显示console.log的想法:
var call = function() {
return new Promise(function(resolve, reject) {
resolve();
console.log("Doing more stuff, should not be visible after a resolve!");
});
};
call().then(function() {
console.log("resolved");
});
Run Code Online (Sandbox Code Playgroud)
我在 Maven 3.2.1 中使用 JFrog artifactory 3.2.1.1。
我上传了一个已构建的项目,该项目存在于存储库浏览器下的 libs-snapshot-local 中。如果我浏览到 com.foo.project,我将在 artifactory 浏览器中看到 project-1.0-20151113.133436-1.jar 文件和 pom 和元数据。
甚至访问http://example.com:8081/artifactory/webapp/browserepo.html?42&pathId=libs-snapshot-local:com/foo/project/1.0-SNAPSHOT/project-1.0-20151113.133436-1.jar向我展示了里面的jar文件。
我使用了 artifactory 中的 settings.xml 生成器来生成<repository>我在以下 pom.xml 中使用的标签:
<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.foo.bar</groupId>
<artifactId>exampleApp</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>exampleApp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://example.foo:8081/artifactory/libs-snapshot</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>prepare-package</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.foo</groupId>
<artifactId>project</artifactId>
<version>1.0</version>
<type>jar</type>
<includes>myFolder</includes>
<outputDirectory>${project.build.directory}/newFolder/js/gmoketest</outputDirectory>
</artifactItem> …Run Code Online (Sandbox Code Playgroud)