thelastpickle / cassandra-reaper

Automated Repair Awesomeness for Apache Cassandra
http://cassandra-reaper.io/
Apache License 2.0
489 stars 217 forks source link

Building with dockerbuild_build does not build JAR #890

Open simonfontana opened 4 years ago

simonfontana commented 4 years ago

Project board link

How to reproduce

Build without using Maven cache. Either delete your Maven cache or remove the .m2 volume in docker-compose.yaml.

Follow these instructions: http://cassandra-reaper.io/docs/download/docker/

cd src/packaging/docker-build
docker-compose build
docker-compose run build

You should get the following output:

$ docker-compose run build
+ cd /usr/src/app/cassandra-reaper
++ printf 'VER\t${project.version}'
++ mvn help:evaluate
++ grep '^VER'
++ cut -f2
+ export VERSION=2.1.0-SNAPSHOT
+ VERSION=2.1.0-SNAPSHOT
+ cd /usr/src/app/cassandra-reaper/src/packaging
+ make build-packages
echo "2.1.0-SNAPSHOT..."
2.1.0-SNAPSHOT...
rm -Rf packages/*
rm -Rf build/*
mkdir -p build/usr/share/cassandra-reaper
mkdir -p build/usr/local/bin
mkdir -p build/etc/init.d
mkdir -p build/etc/cassandra-reaper
mkdir -p build/etc/cassandra-reaper/configs
mkdir -p build/etc/bash_completion.d
mkdir -p build/lib/systemd/system/
cp resource/cassandra-reaper.yaml build/etc/cassandra-reaper/
cp resource/cassandra-reaper*.yaml build/etc/cassandra-reaper/configs
cp resource/cassandra-reaper-ssl.properties build/etc/cassandra-reaper/configs
cp ../server/target/cassandra-reaper-2.1.0-SNAPSHOT.jar build/usr/share/cassandra-reaper/
cp: cannot stat '../server/target/cassandra-reaper-2.1.0-SNAPSHOT.jar': No such file or directory
Makefile:20: recipe for target 'prepare' failed
make: *** [prepare] Error 1

Solution

The issue is that the entrypoint only executes the "build-packages" goal, and this goal does not build the JAR.

Since the deb and rpm packages requires JAR package, I suggest the "deb" and "rpm" goals should depend on "package" goal.

┆Issue is synchronized with this Jira Story by Unito ┆Issue Number: REAP-135

simonfontana commented 4 years ago

Okay, so I was going to create a PR, but something is messing with my environment. I think it's my network connection. I'll try again later.

adejanovski commented 2 years ago

@ossarga, can we close this ticket or is there more work to do here?

ossarga commented 2 years ago

@adejanovski there is some minor work to be done on this. I have left some requested changes on the PR. Just waiting for @simonfontana to reply back.