Skip to content

Commit

Permalink
Merge branch 'feature/test'
Browse files Browse the repository at this point in the history
  • Loading branch information
reiz committed Aug 3, 2016
2 parents 662fb67 + 0ed6731 commit cb0e38f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- Version 2.0.1 with Maven 3.0.5 [![Dependency Status](http://www.versioneye.com/user/projects/5379ad3f14c158ccc700002d/badge.svg?style=flat)](http://www.versioneye.com/user/projects/5379ad3f14c158ccc700002d)
- Version 3.10.0 with Maven 3.3.9 [![Dependency Status](https://www.versioneye.com/user/projects/544d0ff9512592562c000003/badge.svg?style=flat)](https://www.versioneye.com/user/projects/544d0ff9512592562c000003)
- Version 3.10.1 with Maven 3.3.9 [![Dependency Status](https://www.versioneye.com/user/projects/544d0ff9512592562c000003/badge.svg?style=flat)](https://www.versioneye.com/user/projects/544d0ff9512592562c000003)

[![VersionEye Dependencies](src/site/images/VersionEyeLogo.png)](https://www.versioneye.com)

Expand Down Expand Up @@ -43,7 +43,7 @@ You can add the plugin to your project by adding this snippet to your
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -138,7 +138,7 @@ Now let the versioneye-maven-plugin know what your *API KEY* is.
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<apiKey>MY_SECRET_API_KEY</apiKey>
</configuration>
Expand Down Expand Up @@ -173,7 +173,7 @@ If you want so you can configure another place for the versioneye.properties fil
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<propertiesPath>${basedir}/versioneye.properties</propertiesPath>
</configuration>
Expand Down Expand Up @@ -238,7 +238,7 @@ By the way. If you don't like to have a `versioneye.properties` file you can set
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<projectId>_YOUR_VERSONEYE_PROJECT_ID_</projectId>
</configuration>
Expand Down Expand Up @@ -298,7 +298,7 @@ If you are behind a proxy server you can configure the plugin for that like this
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<proxyHost>127.0.0.1</proxyHost>
<proxyPort>8888</proxyPort>
Expand Down Expand Up @@ -326,7 +326,7 @@ The whole plugin snippet would look similar to this one.
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<baseUrl>http://versioneye.my-company.com</baseUrl>
<projectId>_YOUR_VERSONEYE_PROJECT_ID_</projectId>
Expand All @@ -346,7 +346,7 @@ Assume you have a big Java Enterprise multi-module project with Maven and you wa
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<apiKey>MY_SECRET_API_KEY</apiKey>
</configuration>
Expand Down Expand Up @@ -383,7 +383,7 @@ The VersionEye Maven Plugin has many configuration options.
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<projectId>544d0ff9512592562c000003</projectId>
<!--<apiKey>my_secret_api_key</apiKey>-->
Expand Down
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<packaging>maven-plugin</packaging>

<name>versioneye-maven-plugin</name>
Expand Down Expand Up @@ -113,7 +113,7 @@
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<!--<apiKey>YOUR_API_KEY</apiKey> --> <!-- To find here: https://www.versioneye.com/settings/api -->
<!--<baseUrl>http://localhost:3000</baseUrl>-->
Expand Down Expand Up @@ -148,7 +148,6 @@
</configuration>
</plugin>


<!-- mvn gpg:sign -->
<!-- mvn gpg:sign-and-deploy-file -->
<!-- mvn clean deploy -Dgpg.passphrase=my_secret_passphrase -->
Expand Down
21 changes: 16 additions & 5 deletions src/main/java/com/versioneye/SuperMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,29 @@ protected String fetchProjectId() throws Exception {
if (projectId != null && !projectId.isEmpty() )
return projectId;

propertiesPath = projectDirectory + "/src/qa/resources/" + propertiesFile;
String project_id = getPropertyFromPath(propertiesPath, "project_id");
if (propertiesPath != null && !propertiesPath.isEmpty()){
String project_id = getPropertyFromPath(propertiesPath, "project_id");
if (project_id != null && !project_id.isEmpty()){
projectId = project_id;
}
}

String pPath1 = projectDirectory + "/src/qa/resources/" + propertiesFile;
String project_id = getPropertyFromPath(pPath1, "project_id");
if (project_id != null && !project_id.isEmpty()){
projectId = project_id;
propertiesPath = pPath1;
}

propertiesPath = projectDirectory + "/src/main/resources/" + propertiesFile;
project_id = getPropertyFromPath(propertiesPath, "project_id");
String pPath2 = projectDirectory + "/src/main/resources/" + propertiesFile;
project_id = getPropertyFromPath(pPath2, "project_id");
if (project_id != null && !project_id.isEmpty()){
projectId = project_id;
propertiesPath = pPath2;
}

if (projectId == null || projectId.isEmpty()){
String msg = "versioneye.properties found but without project_id! Read the instructions at https://github.com/versioneye/versioneye_maven_plugin";
String msg = "Searched in " + pPath1 + " and " + pPath2 + " for project_id but could't find any. Read the instructions at https://github.com/versioneye/versioneye_maven_plugin";
getLog().error(msg);
throw new MojoExecutionException(msg);
}
Expand Down Expand Up @@ -292,6 +301,8 @@ private String getPropertyFromPath(String propertiesPath, String propertiesKey )
PropertiesUtils propertiesUtils = new PropertiesUtils();
Properties homeProperties = propertiesUtils.readProperties(propertiesPath);
return homeProperties.getProperty(propertiesKey);
} else {
getLog().info("File " + propertiesPath + " does not exist");
}
return null;
}
Expand Down

0 comments on commit cb0e38f

Please sign in to comment.