So I created an amp project, both repo and share, and every time I try to build or run the project it fails with:
java.lang.NoClassDefFoundError: de/schlicht
You need to add TrueZIP Maven Plugin dependency and its drivers into your pom.xml
file, e.g.
...
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>truezip-maven-plugin</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>de.schlichtherle.truezip</groupId>
<artifactId>truezip-driver-file</artifactId>
<version>7.7.9</version>
</dependency>
<dependency>
<groupId>de.schlichtherle.truezip</groupId>
<artifactId>truezip-kernel</artifactId>
<version>7.7.9</version>
</dependency>
<dependency>
<groupId>de.schlichtherle.truezip</groupId>
<artifactId>truezip-driver-zip</artifactId>
<version>7.7.9</version>
</dependency>
</dependencies>
...
For further debugging, try adding -X
flag for your mvn
command.
When the mapping specified in file-mapping.properties
is incorrect (not parsable by alfresco maven) then throws this error.
I am not sure why it is not able to parse the mapping. But it throws error on:
web/=/
but not on:
/web/=/
This should actually work. So I wonder if there's something weird in your env. Any chance you can delete the local copy of that library (~/.m2/repository/de/schlichterle/truezip
) and retry?
I wonder if you have a corrupted version.
Sounds weird though that it works when you change the version...
I had the same error.
I had at one point run maven as root.
I tried removing ~/.m2/repository/de/schlichterle/truezip
. This did not help.
I then removed the target directory, which had some files in it owned by the root user. I don't fully understand why this fixed it, but it did.
After running maven again, the ~/.m2/repository/de/schlichterle/truezip
directory still does not exist, but apparently it is not needed as everything is working fine.
The error log says:
java.lang.NoClassDefFoundError
That means that there is a missing class on your code. You're using Alfresco, then, it means that you have missing dependencies. Jeff Pott's tutorials are a little deprecated now.
You need to add to your pom.xml
file, dependencies for truezip
, truezip-driver
and truezip-file
. Then, re-run and it works.