Skip to content

Commit

Permalink
Added explain for developing. (#160)
Browse files Browse the repository at this point in the history
How to compile etc..
  • Loading branch information
iwai-wovn authored Oct 12, 2020
1 parent 3f274dc commit ce94c70
Showing 1 changed file with 94 additions and 0 deletions.
94 changes: 94 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# For developers

## Compile

To compile, just run the make command. (default is jdk8)

```
make
```

If you want to change the version of the jdk, just pass the VERSION argument to the make command.
The following is an example of compiling with jdk7.

```
make VERSION=7
```

Note: If you are compiling for jdk6, please check the java6_support branch.

## Test

```
make test
```

## More

If you want to use the `mvn` command directly, you can register what you are doing in Makefile to Bash's function as follows and do what you want.

```bash
wovnjava-mvn () {
docker run -it --rm -v ${PWD}:/project -v wovnjava-maven_repo:/root/.m2 -w /project maven:3-jdk-8 mvn $@
}


wovnjava-mvn build -f pom.xml

wovnjava-mvn test -f pom.xml
```

## How to use it in docker

If you want to use a locally compiled version of wovnjava, please use the following method.

Remove or comment out the repository configuration in jitpack.io and enable the dependency systemPath instead.

docker/java8/hello/pom.xml:

```
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
<!-- end -->
</repository>
</repositories>
```

Make sure you have the correct version number enabled in dependency.

docker/java8/hello/pom.xml:

```
<dependencies>
<dependency>
<groupId>com.github.wovnio</groupId>
<artifactId>wovnjava</artifactId>
<version>1.4.0</version>
<!-- If you use local compiled version. -->
<scope>system</scope>
<systemPath>${basedir}/lib/wovnjava-1.4.0-jar-with-dependencies.jar</systemPath>
</dependency>
</dependencies>
```

Copy the locally compiled wovnjava to the lib directory of the Hello project.
Compile the Hello project together with wovnjava.

```
mkdir -p docker/java8/hello/src/main/webapp/WEB-INF/lib/
cp target/wovnjava-1.4.0-jar-with-dependencies.jar docker/java8/hello/src/main/webapp/WEB-INF/lib/
cd docker/java8
./maven-clean-package.sh
```

For more information on how to use the docker environment, please refer to the following

[docker/README.md](docker/README.md)

0 comments on commit ce94c70

Please sign in to comment.