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

Race conditions when building https://github.com/apache/jackrabbit-filevault #408

Closed
kwin opened this issue May 10, 2021 · 8 comments
Labels
wontfix This will not be worked on

Comments

@kwin
Copy link
Member

kwin commented May 10, 2021

Whenever I try to execute mvnd clean verify on the master branch of https://github.com/apache/jackrabbit-filevault I get different race condition failures, e.g.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.1.0:resources (default-resources) on project org.apache.jackrabbit.vault: Cannot create resource output directory: /Users/konradwindszus/git/jackrabbit-filevault/vault-core/target/classes -> [Help 1

or

[ERROR] Failed to execute goal biz.aQute.bnd:bnd-resolver-maven-plugin:5.3.0:resolve (default) on project vault-sync: Unable to resolve <<INITIAL>>: missing requirement osgi.identity;filter:='(osgi.identity=vault-sync)' [caused by: Unable to resolve vault-sync version=3.4.11.SNAPSHOT: missing requirement osgi.wiring.package;filter:='(&(osgi.wiring.package=javax.jcr)(version>=2.0.0)(!(version>=3.0.0)))';osgi.wiring.package='javax.jcr'] -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) on project org.apache.jackrabbit.vault: Failed to clean project: Failed to delete /Users/konradwindszus/git/jackrabbit-filevault/vault-core/target/classes/org -> [Help 1]

I am a bit puzzled why the parallel execution of the modules lead to such issues. Any hints what I need to modify in the pom.xml to make it work with mvnd or did I hit a bug in mvnd?

mvnd --version
mvnd native client 0.4.3-darwin-amd64 (e20989ddd440928f392f839c282c6ef196107404)
Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jansi.osx.OsXNativePty
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/mvnd/0.4.3/libexec/mvn
Java version: 11.0.10, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
@gnodet
Copy link
Contributor

gnodet commented May 12, 2021

I think the problem comes from the javadoc aggregation which creates forked lifecycles and those are not properly synchronized with the main lifecycle.
Fwiw, the problem is not specific to mvnd per se, as running mvn -T4C clean verify also fails in a similar way.

@kwin
Copy link
Member Author

kwin commented May 12, 2021

Thanks for the input. Any other recommendation how to create an aggregate javadoc which is compliant with multi threading/mvnd?

@gnodet
Copy link
Contributor

gnodet commented May 12, 2021

Thanks for the input. Any other recommendation how to create an aggregate javadoc which is compliant with multi threading/mvnd?

Adding the dependencies directly on the plugin definition seems to work around the problem:

    <build>
        <plugins>
            <!-- ====================================================================== -->
            <!-- J A V A D O C   P L U G I N                                            -->
            <!-- ====================================================================== -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <!-- Default configuration for all reports -->
                    <windowtitle>Apache Jackrabbit FileVault ${project.version} API</windowtitle>
                    <doctitle>Apache Jackrabbit FileVault ${project.version} API</doctitle>
                    <excludePackageNames>
                        org.apache.jackrabbit.vault.cli*,org.apache.jackrabbit.vault.davex,*.impl*,org.apache.jackrabbit.vault.util.xml,org.apache.jackrabbit.vault.vlt.actions,org.apache.jackrabbit.vault.vlt.meta.*,org.apache.jackrabbit.vault.packaging.hotfix,org.apache.jackrabbit.vault.validation.impl*,org.apache.jackrabbit.vault.validation.spi.impl
                    </excludePackageNames>
                    <reportOutputDirectory>${basedir}/vault-doc/target/site</reportOutputDirectory>
                    <additionalparam>-notimestamp</additionalparam>
                    <detectLinks>true</detectLinks>
                    <detectJavaApiLink>true</detectJavaApiLink>
                    <links>
                        <link>https://docs.adobe.com/content/docs/en/spec/javax.jcr/javadocs/jcr-2.0/</link>
                        <link>https://jackrabbit.apache.org/api/2.20/</link>
                        <link>https://www.javadoc.io/doc/org.apache.jackrabbit/oak-jackrabbit-api/1.32.0/</link>
                    </links>
                </configuration>
                <executions>
                    <execution>
                        <id>aggregate</id>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                        <phase>site</phase>
                    </execution>
                    <execution>
                        <id>aggregate-jar</id>
                        <goals>
                            <goal>aggregate-jar</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.jackrabbit.vault</groupId>
                        <artifactId>vault-cli</artifactId>
                        <version>3.4.11-SNAPSHOT</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.jackrabbit.vault</groupId>
                        <artifactId>org.apache.jackrabbit.vault</artifactId>
                        <version>3.4.11-SNAPSHOT</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.jackrabbit.vault</groupId>
                        <artifactId>vault-davex</artifactId>
                        <version>3.4.11-SNAPSHOT</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.jackrabbit.vault</groupId>
                        <artifactId>vault-diff</artifactId>
                        <version>3.4.11-SNAPSHOT</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.jackrabbit.vault</groupId>
                        <artifactId>org.apache.jackrabbit.vault.rcp</artifactId>
                        <version>3.4.11-SNAPSHOT</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.jackrabbit.vault</groupId>
                        <artifactId>vault-sync</artifactId>
                        <version>3.4.11-SNAPSHOT</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.jackrabbit.vault</groupId>
                        <artifactId>vault-validation</artifactId>
                        <version>3.4.11-SNAPSHOT</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.jackrabbit.vault</groupId>
                        <artifactId>vault-vlt</artifactId>
                        <version>3.4.11-SNAPSHOT</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

@gnodet
Copy link
Contributor

gnodet commented May 12, 2021

Ah, and you also need to add a maven dependency from vault-sync to org.apache.jackrabbit.vault.target-osgi-environment in order to accommodate the non standard dependency expressed by https://github.com/apache/jackrabbit-filevault/blob/master/vault-sync/aem6.3.bndrun#L15

With those two changes, mvnd can build jackrabbit-filevault successfully.

The first can be considered a bug in mvn/mvnd, but the second is specifically an implicit dependency which should be made explicit.

@kwin
Copy link
Member Author

kwin commented May 12, 2021

Thanks a lot, I already did the latter in apache/jackrabbit-filevault@01f6c39 and in the meantime only build the javadocs during releases.

@kwin
Copy link
Member Author

kwin commented May 12, 2021

@gnodet Are you gonna report a bug for m-javadoc-plugin? Something I can watch?

@gnodet
Copy link
Contributor

gnodet commented May 12, 2021

@gnodet Are you gonna report a bug for m-javadoc-plugin? Something I can watch?

The problem is not specific to the javadoc plugin, it's rather a bug in the core maven. I've sent an email to the dev list and if I open a JIRA issue, I'll link it here. We can keep this issue opened for a bit, I'll close later with the jira issue link.

@gnodet
Copy link
Contributor

gnodet commented May 17, 2021

I've raised https://issues.apache.org/jira/browse/MNG-7156 to fix the underlying problem in maven.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants