Skip to content

Commit

Permalink
Added enforcing of package naming to maven and java classes
Browse files Browse the repository at this point in the history
  • Loading branch information
klaren committed Feb 21, 2018
1 parent 0afe49f commit ef95062
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 44 deletions.
34 changes: 12 additions & 22 deletions community/cypher/pom.xml
Expand Up @@ -106,28 +106,18 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce-dont-exist</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireFilesDontExist>
<files>
<file>cypher-compiler-3.2</file>
<file>cypher-compiler-3.1</file>
<file>cypher-compiler-3.0</file>
<file>cypher-compiler-2.3</file>
</files>
</requireFilesDontExist>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
<configuration>
<rules combine.children="append">
<requireFilesDontExist>
<files>
<file>cypher-compiler-3.2</file>
<file>cypher-compiler-3.1</file>
<file>cypher-compiler-3.0</file>
<file>cypher-compiler-2.3</file>
</files>
</requireFilesDontExist>
</rules>
</configuration>
</plugin>
</plugins>

Expand Down
34 changes: 12 additions & 22 deletions enterprise/cypher/pom.xml
Expand Up @@ -106,28 +106,18 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce-dont-exist</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireFilesDontExist>
<files>
<file>cypher-compiler-3.2</file>
<file>cypher-compiler-3.1</file>
<file>cypher-compiler-3.0</file>
<file>cypher-compiler-2.3</file>
</files>
</requireFilesDontExist>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
<configuration>
<rules combine.children="append">
<requireFilesDontExist>
<files>
<file>cypher-compiler-3.2</file>
<file>cypher-compiler-3.1</file>
<file>cypher-compiler-3.0</file>
<file>cypher-compiler-2.3</file>
</files>
</requireFilesDontExist>
</rules>
</configuration>
</plugin>
</plugins>

Expand Down
32 changes: 32 additions & 0 deletions pom.xml
Expand Up @@ -139,6 +139,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>enforce</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand All @@ -162,6 +173,27 @@
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<rules>
<evaluateBeanshell>
<message>Maven module has to be in a "groupId" beginning with "org.neo4j"</message>
<condition>String s = "${project.groupId}"; s.startsWith("org.neo4j")</condition>
</evaluateBeanshell>
<requireFilesDontExist>
<message>You are not allowed to have classes in "com" package</message>
<files>
<file>${project.build.sourceDirectory}/com</file>
<file>${project.build.testSourceDirectory}/com</file>
</files>
</requireFilesDontExist>
</rules>
<fail>true</fail>
</configuration>
</plugin>
<plugin>
<groupId>org.neo4j.build.plugins</groupId>
<artifactId>clirr-maven-plugin</artifactId>
Expand Down

0 comments on commit ef95062

Please sign in to comment.