versioneye / versioneye_maven_plugin

Maven Plugin for VersionEye
50 stars 22 forks source link

mvn versioneye:update HANGS when updating multimodule project that has a new module #74

Closed ghost closed 7 years ago

ghost commented 7 years ago

mvn versioneye:update HANGS when updating multimodule project that has a new module. The existing modules get updated, but once a new module is seen, the process hangs forever. It would be nice if one could put all required VersionEye Maven plugin values into the ~/.m2/versioneye.properties file (e.g. api_key, baseURL, project_id, visibility, organisation, team) instead of having to also put it into pom.xml, and be able to give a SINGLE maven command to have VersionEye update the existing module analyses AND create new module analyses for any new modules.

No known workaround, as one cannot simply analyze each pom.xml individually (e.g. use mvn versioneye:create for the new modules, making appropriate changes to these modules pom.xml to ensure that they are properly parented), because the Maven properties such as definitions of versions may occur in a higher-level pom.xml, and so analysis would not know what versions of third-party components are invoked, except symbolically.

~/.m2/versioneye.properties api_key=MY-API-KEY baseUrl=ENTERPRISE-VERSIONEYE-URL project_id=PROJECTID-OF-EXISTING-PROJECT-TO-BE-UPDATED

excerpted from pom.xml of top-level directory of local git repository that has many submodules:

<plugin>
  <groupId>com.versioneye</groupId>
  <artifactId>versioneye-maven-plugin</artifactId>
  <version>3.11.0</version>
  <configuration>
    <projectId>PROJECTID-OF-EXISTING-PROJECT-TO-BE-UPDATED</projectId>
    <baseUrl>ENTERPRISE-VERSIONEYE-URL</baseUrl>
    <visibility>private</visibility>
    <propertiesPath>/Users/comet/.m2/versioneye.properties</propertiesPath>
    <organisation>ORGANISATION-OF-PREEXISTING-PROJECT</organisation>
    <team>TEAM-OF-PREEXISTING-PROJECT</team>
  </configuration>
</plugin>

tail of output from mvn versoneye:update

[INFO] You can find your updated project here: 
ENTERPRISE-VERSIONEYE-URL/user/projects/PROJECTID-OF-EXISTING-PROJECT-TO-BE-UPDATED
[INFO] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building BRAND-NEW-MODULE MODULE-VERSION
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- versioneye-maven-plugin:3.11.0:update (default-cli) @ BRAND-NEW-MODULE ---
[INFO] .
[INFO] Starting to update dependencies to server. This can take a couple seconds ... 
[INFO] .
[INFO] File FOLDER-WITH-NEW-MODULE-CODE/src/qa/resources/versioneye.properties does not exist
[INFO] File FOLDER-WITH-NEW-MODULE-CODE/src/main/resources/versioneye.properties does not exist
reiz commented 7 years ago

Hi @Comet-Symphony. Indeed that is a use case I never thought about. I can imagine what the problem is and will work on this today!

reiz commented 7 years ago

Hi @Comet-Symphony. I could reproduce it. If I add a new module and run mvn versioneye:update it fails with this exception:

Searched in [/Users/reiz/workspace/versioneye/crawl_j/jcrawler/src/qa/resources/versioneye.properties, /Users/reiz/workspace/versioneye/crawl_j/jcrawler/src/main/resources/versioneye.properties, null] for project_id but could't find any.
    at com.versioneye.SuperMojo.fetchProjectId(SuperMojo.java:216)
    at com.versioneye.UpdateMojo.uploadDependencies(UpdateMojo.java:53)
    at com.versioneye.UpdateMojo.execute(UpdateMojo.java:41)

But in your configuration above I can see another failure. If you are using the plugin in a parent pom.xml with modules you should NOT keep the hard coded project ID in the plugin configuration. That will cause a wrong behaviour. In Maven Reactor Builds the VersionEye Maven Plugin is creating a project for each module and for each module the plugin is creating a versioneye.properties file which contains the corresponding ID. In your XML example above I would remove the project ID and the propertiesPath.

reiz commented 7 years ago

I'm still working on a solution to handle newly added modules.

reiz commented 7 years ago

@Comet-Symphony The last commit is fixing the issue. Now the UpdateMojo will create a new project for newly added modules and merge it into the VersionEye parent project. I will clean up a bit and then publish a new version to Maven Central.

reiz commented 7 years ago

@Comet-Symphony it is release now. Simply update to version 3.11.1 and run mvn versioneye:update again.

Here are the change logs: https://github.com/versioneye/versioneye_maven_plugin/releases/tag/3.11.1.