Skip to content

Commit

Permalink
download new versions from maven central (via #67)
Browse files Browse the repository at this point in the history
  • Loading branch information
eroshenkoam authored Dec 19, 2018
1 parent cf22510 commit e294821
Show file tree
Hide file tree
Showing 32 changed files with 221 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/it/aggregate-multi-module-exclude-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</reportSet>
</reportSets>
<configuration>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/aggregate-multi-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</reportSet>
</reportSets>
<configuration>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/aggregate-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</reportSet>
</reportSets>
<configuration>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/bulk-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</reports>
<configuration>
<inputDirectories>first/,second/</inputDirectories>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</reportSet>
</reportSets>
Expand Down
2 changes: 1 addition & 1 deletion src/it/categories-file-support-test-classpath/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<version>@project.version@</version>
<configuration>
<propertiesFilePath>allure.properties</propertiesFilePath>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
3 changes: 1 addition & 2 deletions src/it/categories-file-support-test-classpath/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ def cateforiesPath = dataDirectory.resolve("categories.json")
def jsonSlurper = new JsonSlurper()
def categories = jsonSlurper.parseText(cateforiesPath.text)

assert categories.statistic
assert categories.statistic.failed == 1
assert categories.children.size == 1
49 changes: 49 additions & 0 deletions src/it/custom-url-report/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.qameta.allure-maven.it</groupId>
<artifactId>allure-maven-it</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Allure Report Test</name>

<properties>
<allure.version>1.4.19</allure.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<phase>site</phase>
<goals><goal>report</goal></goals>
</execution>
</executions>
<configuration>
<reportVersion>2.8.0</reportVersion>
<allureDownloadUrl>https://dl.bintray.com/qama/maven/io/qameta/allure/allure-commandline/2.8.0/allure-commandline-2.8.0.zip</allureDownloadUrl>
</configuration>
</plugin>
</plugins>
</build>

<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
</reporting>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:test-suite xmlns:ns2="urn:model.allure.qatools.yandex.ru" start="1412949538848" stop="1412949560045"
version="1.4.4-SNAPSHOT">
<name>my.company.Sample</name>
<test-cases>
<test-case start="1412949539363" stop="1412949539730" status="passed">
<name>sampleTestCase</name>
</test-case>
</test-cases>
</ns2:test-suite>
7 changes: 7 additions & 0 deletions src/it/custom-url-report/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import java.nio.file.Paths

import static io.qameta.allure.maven.TestHelper.checkReportDirectory

def base = Paths.get(basedir.absolutePath, 'target', 'site')

checkReportDirectory(base.resolve('allure-maven-plugin'), 1)
2 changes: 1 addition & 1 deletion src/it/feature-plugins-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<version>${allure.version}</version>
</plugin>
</plugins>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion src/it/feature-should-fail-if-empty-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion src/it/feature-without-version-property/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
<plugin>
Expand Down
49 changes: 49 additions & 0 deletions src/it/old-report-version-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.qameta.allure-maven.it</groupId>
<artifactId>allure-maven-it</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Allure Report Test</name>

<properties>
<allure.version>1.4.19</allure.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<phase>site</phase>
<goals><goal>report</goal></goals>
</execution>
</executions>
<configuration>
<reportDirectory>${project.build.directory}/site/allure</reportDirectory>
<reportVersion>2.7.0</reportVersion>
</configuration>
</plugin>
</plugins>
</build>

<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
</reporting>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:test-suite xmlns:ns2="urn:model.allure.qatools.yandex.ru" start="1412949538848" stop="1412949560045"
version="1.4.4-SNAPSHOT">
<name>my.company.Sample</name>
<test-cases>
<test-case start="1412949539363" stop="1412949539730" status="passed">
<name>sampleTestCase</name>
</test-case>
</test-cases>
</ns2:test-suite>
8 changes: 8 additions & 0 deletions src/it/old-report-version-plugin/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import java.nio.file.Paths

import static io.qameta.allure.maven.TestHelper.checkReportDirectory

def base = Paths.get(basedir.absolutePath, 'target', 'site')

checkReportDirectory(base.resolve('allure'), 1)
checkReportDirectory(base.resolve('allure-maven-plugin'), 1)
2 changes: 1 addition & 1 deletion src/it/properties-file-support-compile-classpath/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
<propertiesFilePath>allure.properties</propertiesFilePath>
</configuration>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion src/it/properties-file-support-configuration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<properties>
<allure.issues.tracker.pattern>http://example.com/%s</allure.issues.tracker.pattern>
</properties>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/properties-file-support-default-location/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/properties-file-support-placeholder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<version>@project.version@</version>
<configuration>
<propertiesFilePath>allure.properties</propertiesFilePath>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/properties-file-support-test-classpath/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<version>@project.version@</version>
<configuration>
<propertiesFilePath>allure.properties</propertiesFilePath>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/properties-file-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<version>@project.version@</version>
<configuration>
<propertiesFilePath>allure.properties</propertiesFilePath>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
4 changes: 2 additions & 2 deletions src/it/report-as-build-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</executions>
<configuration>
<reportDirectory>${project.build.directory}/site/allure</reportDirectory>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand All @@ -40,7 +40,7 @@
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/report-change-report-directory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<version>@project.version@</version>
<configuration>
<reportDirectory>${project.build.directory}/allure</reportDirectory>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/report-change-results-directory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<version>@project.version@</version>
<configuration>
<resultsDirectory>my-results</resultsDirectory>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/report-multi-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/report-with-bundled-version/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</executions>
<configuration>
<reportDirectory>${project.build.directory}/site/allure</reportDirectory>
<reportVersion>2.0.1</reportVersion>
<reportVersion>2.8.1</reportVersion>
</configuration>
</plugin>
</plugins>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/qameta/allure/maven/AllureCommandline.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

public class AllureCommandline {

public static final String ALLURE_DEFAULT_VERSION = "2.7.0";
public static final String ALLURE_DEFAULT_VERSION = "2.8.1";

private static final int DEFAULT_TIMEOUT = 3600;

Expand Down Expand Up @@ -130,7 +130,7 @@ public void download(String allureDownloadUrl, Proxy mavenProxy) throws IOExcept
url = new URL(allureUrl);
} else {
allureZip = Files.createTempFile("allure", ALLURE_DEFAULT_VERSION);
allureUrl = String.format("/allure-%s.zip", ALLURE_DEFAULT_VERSION);
allureUrl = String.format("/allure-commandline-%s.zip", ALLURE_DEFAULT_VERSION);
url = AllureCommandline.class.getResource(allureUrl);
}

Expand Down
15 changes: 8 additions & 7 deletions src/main/java/io/qameta/allure/maven/AllureGenerateMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.*;

import static io.qameta.allure.maven.AllureCommandline.ALLURE_DEFAULT_VERSION;
import static io.qameta.allure.maven.DownloadUtils.getAllureDownloadUrl;
import static java.lang.String.format;

/**
Expand Down Expand Up @@ -97,8 +98,7 @@ public abstract class AllureGenerateMojo extends AllureBaseMojo {
@Parameter(property = "allure.install.directory", defaultValue = "${project.basedir}/.allure")
private String installDirectory;

@Parameter(property = "allure.download.url",
defaultValue = "https://dl.bintray.com/qameta/generic/io/qameta/allure/allure/%s/allure-%s.zip")
@Parameter(property = "allure.download.url")
private String allureDownloadUrl;

@Parameter(property = "session", defaultValue = "${session}", readonly = true)
Expand Down Expand Up @@ -198,14 +198,15 @@ private void loadProperties(List<Path> inputDirectories) throws IOException, Dep

private void installAllure() throws MavenReportException{
try {
getLog().info(String.format("Allure installation directory %s", getInstallDirectory()));
getLog().info(String.format("Try to finding out allure %s", reportVersion != null ? reportVersion : ALLURE_DEFAULT_VERSION));
final String version = reportVersion != null ? reportVersion : ALLURE_DEFAULT_VERSION;
getLog().info(String.format("Allure installation directory %s", installDirectory));
getLog().info(String.format("Try to finding out allure %s", version));

AllureCommandline commandline
= new AllureCommandline(Paths.get(getInstallDirectory()), reportVersion);
AllureCommandline commandline = new AllureCommandline(Paths.get(installDirectory), reportVersion);
if (commandline.allureNotExists()) {
final String url = getAllureDownloadUrl(version, allureDownloadUrl);
getLog().info("Downloading allure commandline...");
commandline.download(allureDownloadUrl, ProxyUtils.getProxy(session, decrypter));
commandline.download(url, ProxyUtils.getProxy(session, decrypter));
getLog().info("Downloading allure commandline complete");
}
} catch (Exception e) {
Expand Down
Loading

0 comments on commit e294821

Please sign in to comment.