Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple MANIFEST.MF in alfrescoWar artifact #257

Open
todorinskiz opened this issue Jan 31, 2022 · 3 comments
Open

Multiple MANIFEST.MF in alfrescoWar artifact #257

todorinskiz opened this issue Jan 31, 2022 · 3 comments

Comments

@todorinskiz
Copy link
Member

todorinskiz commented Jan 31, 2022

Caused by:

childWars.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE);

Any vanilla project should be able to reproduce it.

image

Linked issues: #229 #220

@todorinskiz
Copy link
Member Author

I managed to simplify my use case to:

task buildCustomWar(type: War) {
    dependsOn project.tasks.alfrescoWar
    afterEvaluate {
        def outputDir = mkdir("${project.buildDir}/dist/")
        archiveFileName = "${artifact}-${flavor}-${project.version}.war"
        destinationDirectory = outputDir

        manifest {
            attributes("Implementation-Title":"alfresco")
            attributes("Implementation-Version":"${project.version}")
            attributes("Implementation-Vendor-Id":"eu.xenit.${project.flavor}.war")
        }

        from(zipTree(project.tasks.alfrescoWar.getOutputs().files.singleFile))
    }
}

How I believe this should be consumed is:

alfrescoWar {
    manifest {
        attributes("Implementation-Title":"alfresco")
        attributes("Implementation-Version":"${project.version}")
        attributes("Implementation-Vendor-Id":"eu.xenit.${project.flavor}.war")
    }
}

But this is not possible since neither MergeWarsTask or AbstractWarEnrichmentTask provide option to filter/manipulate the copy specs.

Maybe that's by design? Still, it's much more efficient to manipulate sources on-the-fly rather than waiting for the artifact and then unzip + copy to new artifact.

@vierbergenlars
Copy link
Member

We can not remove DuplicatesStrategy.INCLUDE, because that is necessary for AMPs that overwrite core Alfresco files to work (for example, our hotfix amps).

You should be able to use the manifest function in alfrescoWar, but I don't know if it runs before or after the merging of WAR files.

alfrescoWar {
  manifest {
    // ...
  }
}

@todorinskiz
Copy link
Member Author

possibly related gradle/gradle#17236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants