versioneye/versioneye_maven_plugin

Generated versioneye.properties files should not be stored in src/main/resources

pmonks opened this issue ยท 8 comments

Why? Because by default the contents of that directory are included in the emitted build artifacts (JARs, WARs, etc.), and the versioneye.properties file does not belong there - it should not be included in redistributable runtime artifacts.

reiz commented

@pmonks Where would you expect to store the versioneye.properties file?

Somewhere outside the Maven project's src folder.

I have no strong preference where, but the root folder (i.e. where the pom.xml is located) is an obvious choice, perhaps in a dot file (.versioneye.properties). That's the convention most similar systems (TravisCI, Code Climate, etc.) use for their config files.

reiz commented

The versioneye.properties files stores the project_id, which is the connection between your Maven project and the Project at VersionEye. If you have a Maven multi module project for each module a versioneye.properties file is generated. So far nobody complained about this file. But if you don't like it you could alternatively configure the project_id directly in the corresponding pom.xml file in the plugin configuration section. Then no additional file is needed. But configuring that by hand in each pom.xml file is more work ;-)

I'm not concerned about the existence of these files, merely the poor default location used to store them. As a general principle, development-time artifacts should not leak into runtime - the current choice of location means that this principle is violated.

And yes you're quite right that while it's possible to hardcode the project id into the pom, doing so is onerous. I don't consider that a reasonable alternative in the presence of non-trivial projects.

If you put the versioneye.properties in your ~/.m2 folder it will be found automatically by the versioneye-maven-plugin without any additional configuration (as mentioned in the README). As the default folder for creating this file automatically I would prefer the project root folder.

reiz commented

@pmonks @McPringle the versioneye.properties in ~/.m2 only works with a simple Maven project. It doesn't work with a Maven multi module project. Actually the versioneye.properties in ~/.m2 was only created to keep the API key out side of the source code directory. But the newer versions of this plugin are able to read the API from an global ENV variable as well.

reiz commented

@pmonks @McPringle I just pushed a new version to Maven Central. I close this ticket because you can define the path for the versioneye.properties by yourself.

    <plugin>
      <groupId>com.versioneye</groupId>
      <artifactId>versioneye-maven-plugin</artifactId>
      <version>3.10.1</version>
      <configuration>
        <propertiesPath>${basedir}/versioneye.properties</propertiesPath>
      </configuration>
    </plugin>

Looks good! Thanks @reiz.