DPascalBernard / maven-alfresco-archetypes

Automatically exported from code.google.com/p/maven-alfresco-archetypes
0 stars 0 forks source link

ACP corrupted after building #96

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to use the 3.9.1 of the AMP archetype, if you try to import some ACP 
files for your module using the bootstrap importer of Alfresco, after building 
with Maven these files are corrupted by the Maven Resources Plugin. 

This means that when you have installed the AMP and try to start Alfresco, 
during the bootstrap Alfresco can't read ACP files and it returns the following 
exception:

Caused by: org.alfresco.error.AlfrescoRuntimeException: 06020000 Bootstrap 
failed
    at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:361)
    at org.alfresco.repo.module.ImporterModuleComponent.executeInternal(ImporterModuleComponent.java:107)
    at org.alfresco.repo.module.AbstractModuleComponent.execute(AbstractModuleComponent.java:353)
    ... 61 more
Caused by: org.alfresco.service.cmr.view.ImporterException: Failed to read zip 
file due to null
    at org.alfresco.repo.importer.ACPImportPackageHandler.startImport(ACPImportPackageHandler.java:77)
    at org.alfresco.repo.importer.ImporterComponent.importView(ImporterComponent.java:260)
    at org.alfresco.repo.importer.ImporterBootstrap.doImport(ImporterBootstrap.java:479)
    at org.alfresco.repo.importer.ImporterBootstrap.access$000(ImporterBootstrap.java:70)
    at org.alfresco.repo.importer.ImporterBootstrap$1$1.execute(ImporterBootstrap.java:350)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
    at org.alfresco.repo.importer.ImporterBootstrap$1.doWork(ImporterBootstrap.java:354)
    at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:516)
    at org.alfresco.repo.importer.ImporterBootstrap.bootstrap(ImporterBootstrap.java:357)
    ... 63 more
Caused by: java.io.EOFException
    at java.io.RandomAccessFile.readFully(RandomAccessFile.java:399)
    at java.io.RandomAccessFile.readFully(RandomAccessFile.java:377)
    at org.apache.commons.compress.archivers.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:349)
    at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:184)
    at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:161)
    at org.alfresco.repo.importer.ACPImportPackageHandler.startImport(ACPImportPackageHandler.java:73)
    ... 71 more

The workaround is to add ACP extension to the following snippet in the pom.xml:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <!-- By default as per http://code.google.com/p/maven-alfresco-archetypes/issues/detail?id=7 FTL are not filtered to avoid corruption.
                        | This behavior can be relaxed (in case filtering is needed in the FTLs) by selecting which files are filtered and which not as described 
                        | here http://code.google.com/p/maven-alfresco-archetypes/issues/detail?id=7#c3
                        -->
                    <nonFilteredFileExtensions>
                        <nonFilteredFileExtension>ftl</nonFilteredFileExtension>
                        <nonFilteredFileExtension>acp</nonFilteredFileExtension>
                    </nonFilteredFileExtensions>
                </configuration>
            </plugin>

Anyway I think that by default ACP files must be excluded from filtering 
directly by the archetype.

Hope this helps ;)

Original issue reported on code.google.com by piergiorgiolucidi on 3 Jul 2012 at 7:51

GoogleCodeExporter commented 9 years ago
This is a regression. It used to be there before. We restored this ACP 
exclusion in the 4.x archetypes

Original comment by gabriele...@alfresco.com on 22 Oct 2012 at 10:14

GoogleCodeExporter commented 9 years ago
Fixed for 1.0.0 release (for older versions please refer to the fix mentioned 
by piergiorgio).

Resolving this issue then.

Original comment by colum...@gmail.com on 30 Oct 2012 at 12:30