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

Build error in case XProc pipeline fails #40

Open
esscue23 opened this issue Aug 29, 2019 · 2 comments
Open

Build error in case XProc pipeline fails #40

esscue23 opened this issue Aug 29, 2019 · 2 comments

Comments

@esscue23
Copy link

I'm using the below included pom file to execute some XProc pipeline. In case of errors during execution of the pipelines, the xproc-maven-plugin still shows "BUILD SUCCESS" (below you find an example maven log). How can I configure the plugin to stop the build in case of errors?

The pom file used:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.allianz.apl</groupId>
    <artifactId>apldoc</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>APL Doc pages</name>
    <build>
        <plugins>

            <!-- XProc testing using xprocspec and xproc-maven-plugin -->
            <plugin>
                <groupId>org.daisy.maven</groupId>
                <artifactId>xproc-maven-plugin</artifactId>
                <version>1.0.0</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>xproc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <pipeline>pipe.xpl</pipeline>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.daisy.maven</groupId>
                        <artifactId>xproc-engine-calabash</artifactId>
                        <version>1.1.2</version>
                    </dependency>

                    <dependency>
                        <groupId>org.daisy.libs</groupId>
                        <artifactId>saxon-he</artifactId>
                        <version>9.8.0.8</version>
                    </dependency>


                    <dependency>
                        <groupId>org.daisy.libs</groupId>
                        <artifactId>com.xmlcalabash</artifactId>
                        <version>1.1.20-p2-98</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>

Here the example maven log, where the XProc pipeline failed, but maven still says "BUILD SUCCESS":

[ERROR] Calabash failed to execute XProc
[DEBUG]
com.xmlcalabash.core.XProcException$3: Java heap space
                at com.xmlcalabash.core.XProcException.rebaseOnto(XProcException.java:336)
                at com.xmlcalabash.core.XProcException.rebaseOnto(XProcException.java:305)
                at com.xmlcalabash.runtime.XStep.handleException(XStep.java:313)
                at com.xmlcalabash.runtime.XAtomicStep.run(XAtomicStep.java:398)
                at com.xmlcalabash.runtime.XPipeline.doRun(XPipeline.java:236)
                at com.xmlcalabash.runtime.XPipeline.run(XPipeline.java:136)
                at org.daisy.maven.xproc.calabash.Calabash.run(Calabash.java:170)
                at org.daisy.maven.xproc.calabash.Calabash.run(Calabash.java:146)
                at org.daisy.maven.xproc.plugin.XProcMojo.execute(XProcMojo.java:81)
                at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
                at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
                at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
                at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
                at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
                at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
                at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
                at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
                at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
                at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
                at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
                at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
                at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.OutOfMemoryError: Java heap space
                at net.sf.saxon.tree.tiny.LargeStringBuffer.append(LargeStringBuffer.java:119)
                at net.sf.saxon.tree.tiny.TinyTree.appendChars(TinyTree.java:384)
                at net.sf.saxon.tree.tiny.TinyBuilder.makeTextNode(TinyBuilder.java:399)
                at net.sf.saxon.tree.tiny.TinyBuilder.characters(TinyBuilder.java:381)
                at net.sf.saxon.event.ProxyReceiver.characters(ProxyReceiver.java:190)
                at net.sf.saxon.event.ComplexContentOutputter.characters(ComplexContentOutputter.java:278)
                at net.sf.saxon.tree.tiny.TinyElementImpl.copy(TinyElementImpl.java:380)
                at net.sf.saxon.event.ComplexContentOutputter.append(ComplexContentOutputter.java:663)
                at net.sf.saxon.expr.Expression.process(Expression.java:932)
                at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:472)
                at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
                at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:262)
                at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:353)
                at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:302)
                at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:50)
                at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:327)
                at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:511)
                at net.sf.saxon.expr.LetExpression.process(LetExpression.java:580)
                at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:302)
                at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:50)
                at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:327)
                at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:511)
                at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:692)
                at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
                at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:151)
                at net.sf.saxon.expr.LetExpression.process(LetExpression.java:588)
                at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:472)
                at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:151)
                at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
                at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:284)
                at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
                at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:151)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13:49 min
[INFO] Finished at: 2019-08-28T12:47:28Z
[INFO] Final Memory: 896M/959M
[INFO] ------------------------------------------------------------------------
@bertfrees
Copy link
Member

Hi @esscue23. Yes looks like something is wrong here. If you also include the pipe.xpl file I'll test it.

@esscue23
Copy link
Author

esscue23 commented Sep 4, 2019

Hello @bertfrees, thanks for your answer.

I created a small example pipe leading to the same issue:

<?xml version="1.0"?>
<p:declare-step version="1.0" xmlns:p="http://www.w3.org/ns/xproc" xmlns:apl="http://www.allianz.com/apl/xproc">

<p:store2 href="output.xml" indent="true" omit-xml-declaration="false">
        <p:input port="source">
                <p:document href="input.xml"/>
        </p:input>
</p:store>

</p:declare-step>

By intention it contains a syntax error (p:store2 instead of p:store). But mvn compile still results in "BUILD SUCESS":

[ERROR] err:XD0011:XProc error err:XD0011
[ERROR]     cause: org.xml.sax.SAXParseException; systemId: file:/Users/Sebastian/Documents/workspace/XProc/Identity/pipe.xpl; lineNumber: 8; columnNumber: 3; The element type "p:store2" must be terminated by the matching end-tag "</p:store2>".
[ERROR] Calabash failed to execute XProc
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.917 s
[INFO] Finished at: 2019-09-04T20:31:45+02:00
[INFO] ------------------------------------------------------------------------

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