aem-test-samples icon indicating copy to clipboard operation
aem-test-samples copied to clipboard

ui-selenium-webdriver: The packaging plugin for this project did not assign a main file to the project but it has attachments. Change packaging to 'pom'

Open kwin opened this issue 1 year ago • 5 comments

When executing the first step from https://github.com/adobe/aem-test-samples/blob/aem-cloud/ui-selenium-webdriver/README.md#all-in-one with Maven 3.9.6 you run into the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.1.1:install (default-install) on project com.adobe.cq.cloud.testing.ui.java.ui.tests: The packaging plugin for this project did not assign a main file to the project but it has attachments. Change packaging to 'pom'. -> [Help 1]

This is a new error in introduced with maven-install-plugin 3.0 (https://issues.apache.org/jira/browse/MINSTALL-118). The fix is to convert the packaging to pom.

In addition it is probably never useful to deploy anything for this project to a Maven repository therefore it would be useful to disable it with

<build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
.....

kwin avatar Feb 20 '24 18:02 kwin

@kwin , thanks, I can replicate that locally. From the README, rather a mvn package might be better than the current mvn install.

I will have a check when I have time to adjust it

bisswanger avatar Feb 20 '24 22:02 bisswanger

For me the packaging with maven-assembly-plugin as tar.gz is unclear (https://github.com/adobe/aem-test-samples/blob/1bbacb80c794ce055efa4054103ca953b32b1f12/ui-selenium-webdriver/pom.xml#L81) as that artifact is neither used at all for the docker build/execution nor for the standalone execution. Can you explain, why this is generated at all?

kwin avatar Feb 21 '24 09:02 kwin

@kwin: this is needed to build the actual UI test image within the Cloud Service Pipeline. So this is indeed needed by Cloud Manager as else the tests won't be run.

Details are in the UI testing documentation: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/using-cloud-manager/test-results/functional-testing/ui-testing.html?lang=en#generate-docker-build-context

bisswanger avatar Feb 21 '24 09:02 bisswanger

I would strongly suggest then to put something which is only necessary for Cloud Manager in a dedicated profile only activated on Cloud Manager then. Otherwise every local build takes longer than necessary (due to building this unused archive).

kwin avatar Feb 21 '24 11:02 kwin

Addressed in https://github.com/adobe/aem-test-samples/pull/92

I went the "easy" way and used allowIncompleteProjects for now. This would still build the archive locally, though I removed an unnecessary dependency. With that, the local build for that module takes less than 1 second, so shall not impact the overall build time much

bisswanger avatar Feb 21 '24 13:02 bisswanger