Alfresco Maven SDK - fails if module version string ends with “-SNAPSHOT”

后端 未结 5 1691
眼角桃花
眼角桃花 2021-01-14 04:05

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         


        
相关标签:
5条回答
  • 2021-01-14 04:43

    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.

    0 讨论(0)
  • 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/=/
    
    0 讨论(0)
  • 2021-01-14 04:45

    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...

    0 讨论(0)
  • 2021-01-14 04:55

    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.

    0 讨论(0)
  • 2021-01-14 05:01

    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.

    0 讨论(0)
提交回复
热议问题