Skip to content

Commit

Permalink
Give a way to skip license checks for people outside Neo4j
Browse files Browse the repository at this point in the history
  • Loading branch information
fbiville committed Feb 19, 2024
1 parent f1e3c0f commit 425211b
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 42 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,31 @@ class GettingStarted {

- Maven
- JDK 21 (21 is used for tests, 11 for production sources)

## Contributing

If you do not have access to the `build-resources` dependency of the licensing plugin, the build will fail as follows:

```shell
Execution check-licenses of goal com.mycila:license-maven-plugin:4.3:check failed: Plugin com.mycila:license-maven-plugin:4.3 or one of its dependencies could not be resolved: Failed to collect dependencies at com.mycila:license-maven-plugin:jar:4.3 -> org.neo4j.connectors:build-resources:jar:1.0.0: Failed to read artifact descriptor for org.neo4j.connectors:build-resources:jar:1.0.0: The following artifacts could not be resolved: org.neo4j.connectors:build-resources:pom:1.0.0 (absent): Could not transfer artifact org.neo4j.connectors:build-resources:pom:1.0.0 from/to github (https://maven.pkg.github.com/neo4j/connectors-build-resources): status code: 401, reason phrase: Unauthorized (401)
```

### Working for Neo4j
Make sure to add the right server entry to your own `~/.m2/settings.xml`:

```xml
<servers>
<server>
<id>github</id>
<username>USERNAME</username>
<password>PASSWORD_OR_TOKEN</password>
</server>
</servers>
```

### Working outside Neo4j
You will have to build the project by disabling the licensing profile with `-P'!licensing'`, as in the following example:

```shell
mvn verify -P'!licensing'
```
100 changes: 58 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@
<scope>test</scope>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>github</id>
<url>https://maven.pkg.github.com/neo4j/connectors-build-resources</url>
</pluginRepository>
</pluginRepositories>
<build>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -219,42 +213,64 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>4.3</version>
<configuration>
<strictCheck>true</strictCheck>
<licenseSets>
<licenseSet>
<header>/headers/ASL-2-header.txt</header>
<includes>
<include>src/**/*.kt</include>
<include>src/**/*.java</include>
</includes>
</licenseSet>
</licenseSets>
<mapping>
<kotlin>SLASHSTAR_STYLE</kotlin>
</mapping>
</configuration>
<dependencies>
<dependency>
<groupId>org.neo4j.connectors</groupId>
<artifactId>build-resources</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>check-licenses</id>
<goals>
<goal>check</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>licensing</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<pluginRepositories>
<pluginRepository>
<id>github</id>
<url>https://maven.pkg.github.com/neo4j/connectors-build-resources</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>4.3</version>
<configuration>
<strictCheck>true</strictCheck>
<licenseSets>
<licenseSet>
<header>/headers/ASL-2-header.txt</header>
<includes>
<include>src/**/*.kt</include>
<include>src/**/*.java</include>
</includes>
</licenseSet>
</licenseSets>
<mapping>
<kotlin>SLASHSTAR_STYLE</kotlin>
</mapping>
</configuration>
<dependencies>
<dependency>
<groupId>org.neo4j.connectors</groupId>
<artifactId>build-resources</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>check-licenses</id>
<goals>
<goal>check</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>external</id>
</profile>
</profiles>
</project>

0 comments on commit 425211b

Please sign in to comment.