[BUG] Maven build is broken
Describe the bug
Building with Maven fails with various dependency errors, if using the suggested command of the README.
[INFO] 4 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 39.249 s [INFO] Finished at: 2022-10-26T13:58:25+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project arx: Compilation failure: Compilation failure: [ERROR] /D:/An/Projects/k-anonymity/arx/src/main/org/deidentifier/arx/io/ImportConfigurationExcel.java:[228,52] Symbol nicht gefunden [ERROR] Symbol: Variable CELL_TYPE_STRING [ERROR] Ort: Schnittstelle org.apache.poi.ss.usermodel.Cell [ERROR] /D:/An/Projects/k-anonymity/arx/src/main/org/deidentifier/arx/io/ImportAdapterExcel.java:[112,42] Symbol nicht gefunden [ERROR] Symbol: Variable CREATE_NULL_AS_BLANK [ERROR] Ort: Schnittstelle org.apache.poi.ss.usermodel.Row [ERROR] /D:/An/Projects/k-anonymity/arx/src/main/org/deidentifier/arx/io/ImportAdapterExcel.java:[188,53] Symbol nicht gefunden [ERROR] Symbol: Variable CELL_TYPE_STRING [ERROR] Ort: Schnittstelle org.apache.poi.ss.usermodel.Cell [ERROR] /D:/An/Projects/k-anonymity/arx/src/main/org/deidentifier/arx/io/ImportAdapterExcel.java:[255,82] Symbol nicht gefunden [ERROR] Symbol: Variable CELL_TYPE_STRING [ERROR] Ort: Schnittstelle org.apache.poi.ss.usermodel.Cell [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
To Reproduce Steps to reproduce the behavior:
- Clone the repository on a Windows 10 machine with JDK 19 and Maven 3.8.6 (both stable, newest versions).
- Run the compile command
$ mvn compile -Dcore=true
Expected behavior Successfully build
Additional context Before I got stuck on this error another depency issues did arise:
Failed to execute goal on project arx: Could not resolve dependencies for project org.deidentifier.arx:arx:jar:3.9.1: Could not find artifact com.github.ralfstuckert.pdfbox-layout:pdfbox2-layout:jar:1.0.0 in local-maven-repo (file:///D:\An\Projects\k-anonymity\arx/lib)
I fixed this by changing the version of com.github.ralfstuckert.pdfbox-layout from 1.0.0 to 1.0.1 in the pom.xml:
<dependency>
<groupId>com.github.ralfstuckert.pdfbox-layout</groupId>
<artifactId>pdfbox2-layout</artifactId>
<version>1.0.1</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
Thanks for your interest in ARX.
From ARX Readme:
Currently, the main development of ARX is carried out using Eclipse as an IDE and Ant as a build tool. Support for further IDEs such as IntelliJ IDEA and Maven is experimental.
Have you tried compiling using eclipse?
Actually no. I did not use Eclipse. I just executed the build command from the command line. See my described steps to reproduce. All required frameworks and tools, like Java and Maven were installed manually. But if you do not plan to support this way of creating a build feel free to close this issue. Just wondering what is different with Eclipse.
Thanks for reporting this. The standard way of building ARX is by using the Ant build script provided. Would that be an option for you? The Maven build is experimental and likely not up to date (as you discovered). Is there a specific reason you need to build with Maven?
The reason why I chose the Maven build was because I did not want to install the whole Eclipse IDE etc, but just compile the core components, as you described in the README with the mvn command > https://github.com/arx-deidentifier/arx#development-setup.
The background of this or better my goal would be to access the FLASH algorithm with a Python script with the help of Python-Java bridge. However I probably don't even need to compile the core component to access it via Python. I need to do some more research here :)
Ok. Thanks for the feedback. The text in the readme is a bit misleading. Building with Maven is an experimental feature and obviously broken at the moment (thanks for reporting this).
The standard way of building ARX is with Ant. This can also be done without Eclipse and also allows building just the core library.
Yep. Just tried with debian and java 8 as recommended. Still broken :-( Unfortunately the suggested fix wasnt enough for making it work. I hope it fixes eventually. I'm attempting to include ARX in my cicd process, and therefore, compiling it in eclipse is not a viable option.
BTW, thanks for this tool!
Thanks for trying again. Just to be sure: you can also build ARX without Eclipse - by using Ant.
Hello @prasser thanks for the quick reply. I tried with ant and it compiled. However, only works for amd64 arq. It failed in apple Mac M1 and also linux arm64. I noticed that is due to a gui dependency. Is it possible to use the tool in headless mode? I take samples of my database and my idea is to anonymize this sample for development tests. I wonder if that can be achieved with arx. If so, my goal is to integrate that to my CICD pipeline. thanks a lot
Is it possible to use the tool in headless mode?
Sure. You can use libarx and implement the anonymization process in Java. You can take a look at the "example" package for info on how to use the API.
I was able to build Arx in windows using maven e.g.
mvn install -DskipTests
after commenting out these dependencies in pom.xml :
probably one can do the same for their system e.g.
<!-- <dependencies>
<dependency>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
<version>3.114.100</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies> -->
The tests will fail as there are data files missing e.g. atus.csv, hence using -DskipTests.
Update: I found out that this does not fix the errors mentioned in the bug when using Ubuntu.
With this PR, I was able to install Arx on both Windows 10 and Ubuntu 22.04 using maven.