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

feat(#64): Omit XML Header in Xembler Output #165

Merged
merged 7 commits into from
Nov 16, 2023

Conversation

volodya-lombrozo
Copy link
Contributor

Omit the following XML header in Xembler output:

<?xml version="1.0" encoding="UTF-8"?>

To do so, we now can use the following:

new Xembler(directives, new Output.Node()).xml();

Closes: #64.

@volodya-lombrozo
Copy link
Contributor Author

@yegor256 Could you take a look, please? I need that feature in other project.

@yegor256
Copy link
Owner

yegor256 commented Nov 15, 2023

@volodya-lombrozo maybe it's better to move the creation of Transformer into this new object too? And rename it to Tranformers. Then:

interface Transformers
  Transformer create()

class DefaultTransformers implements Transformers
  Transformer create()
    // here we just create it

class FormattedTransformers implements Transformers
  Transformers origin;
  Transformer create()
    // here we set properties

Then, by default Xembler will encansulate new FormattedTransformers(new DefaultTransformers()). But for your specific case, you will instantiate it only with new DefaultTransformers. Vertical decorating, so to speak: https://www.yegor256.com/2015/10/01/vertical-horizontal-decorating.html

@volodya-lombrozo
Copy link
Contributor Author

@yegor256 Could you take a look one more time, please?

@yegor256
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Nov 16, 2023

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit d4ae687 into yegor256:master Nov 16, 2023
9 checks passed
@rultor
Copy link
Collaborator

rultor commented Nov 16, 2023

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 6min)

@volodya-lombrozo
Copy link
Contributor Author

@yegor256 Could you release a new version, please?

@yegor256
Copy link
Owner

@rultor release, tag is 0.29.0

@rultor
Copy link
Collaborator

rultor commented Nov 16, 2023

@rultor release, tag is 0.29.0

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented Nov 16, 2023

@rultor release, tag is 0.29.0

@volodya-lombrozo @yegor256 Oops, I failed. You can see the full log here (spent 6min)

    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (\u001b[1mSingleThreadedBuilder.java:53\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.LifecycleStarter.execute (\u001b[1mLifecycleStarter.java:118\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.DefaultMaven.doExecute (\u001b[1mDefaultMaven.java:261\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.DefaultMaven.doExecute (\u001b[1mDefaultMaven.java:173\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.DefaultMaven.execute (\u001b[1mDefaultMaven.java:101\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.cli.MavenCli.execute (\u001b[1mMavenCli.java:827\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.cli.MavenCli.doMain (\u001b[1mMavenCli.java:272\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.cli.MavenCli.main (\u001b[1mMavenCli.java:195\u001b[m)
    \u001b[1mat\u001b[m jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (\u001b[1mNative Method\u001b[m)
    \u001b[1mat\u001b[m jdk.internal.reflect.NativeMethodAccessorImpl.invoke (\u001b[1mNativeMethodAccessorImpl.java:62\u001b[m)
    \u001b[1mat\u001b[m jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (\u001b[1mDelegatingMethodAccessorImpl.java:43\u001b[m)
    \u001b[1mat\u001b[m java.lang.reflect.Method.invoke (\u001b[1mMethod.java:566\u001b[m)
    \u001b[1mat\u001b[m org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (\u001b[1mLauncher.java:282\u001b[m)
    \u001b[1mat\u001b[m org.codehaus.plexus.classworlds.launcher.Launcher.launch (\u001b[1mLauncher.java:225\u001b[m)
    \u001b[1mat\u001b[m org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (\u001b[1mLauncher.java:406\u001b[m)
    \u001b[1mat\u001b[m org.codehaus.plexus.classworlds.launcher.Launcher.main (\u001b[1mLauncher.java:347\u001b[m)
\u001b[1mCaused by\u001b[m: com.sonatype.nexus.staging.client.StagingRuleFailuresException: \u001b[1;31mStaging rules failure!\u001b[m
    \u001b[1mat\u001b[m com.sonatype.nexus.staging.client.internal.StagingWorkflowV3ServiceImpl.monitorRepositoryTransition (\u001b[1mStagingWorkflowV3ServiceImpl.java:272\u001b[m)
    \u001b[1mat\u001b[m com.sonatype.nexus.staging.client.internal.StagingWorkflowV2ServiceImpl.monitorRepositoryTransition (\u001b[1mStagingWorkflowV2ServiceImpl.java:407\u001b[m)
    \u001b[1mat\u001b[m com.sonatype.nexus.staging.client.internal.StagingWorkflowV2ServiceImpl$10.perform (\u001b[1mStagingWorkflowV2ServiceImpl.java:281\u001b[m)
    \u001b[1mat\u001b[m com.sonatype.nexus.staging.client.internal.StagingWorkflowV2ServiceImpl$10.perform (\u001b[1mStagingWorkflowV2ServiceImpl.java:276\u001b[m)
    \u001b[1mat\u001b[m com.sonatype.nexus.staging.client.internal.ExceptionConverter.runAndReturn (\u001b[1mExceptionConverter.java:38\u001b[m)
    \u001b[1mat\u001b[m com.sonatype.nexus.staging.client.internal.StagingWorkflowV2ServiceImpl.releaseStagingRepositories (\u001b[1mStagingWorkflowV2ServiceImpl.java:285\u001b[m)
    \u001b[1mat\u001b[m com.sonatype.nexus.staging.client.internal.StagingWorkflowV3ServiceImpl.releaseStagingRepositories (\u001b[1mStagingWorkflowV3ServiceImpl.java:91\u001b[m)
    \u001b[1mat\u001b[m org.sonatype.nexus.maven.staging.workflow.ReleaseStageRepositoryMojo.doExecute (\u001b[1mReleaseStageRepositoryMojo.java:55\u001b[m)
    \u001b[1mat\u001b[m org.sonatype.nexus.maven.staging.workflow.AbstractStagingActionMojo.execute (\u001b[1mAbstractStagingActionMojo.java:55\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (\u001b[1mDefaultBuildPluginManager.java:126\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (\u001b[1mMojoExecutor.java:342\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (\u001b[1mMojoExecutor.java:330\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.MojoExecutor.execute (\u001b[1mMojoExecutor.java:213\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.MojoExecutor.execute (\u001b[1mMojoExecutor.java:175\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (\u001b[1mMojoExecutor.java:76\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.MojoExecutor$1.run (\u001b[1mMojoExecutor.java:163\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (\u001b[1mDefaultMojosExecutionStrategy.java:39\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.MojoExecutor.execute (\u001b[1mMojoExecutor.java:160\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (\u001b[1mLifecycleModuleBuilder.java:105\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (\u001b[1mLifecycleModuleBuilder.java:73\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (\u001b[1mSingleThreadedBuilder.java:53\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.lifecycle.internal.LifecycleStarter.execute (\u001b[1mLifecycleStarter.java:118\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.DefaultMaven.doExecute (\u001b[1mDefaultMaven.java:261\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.DefaultMaven.doExecute (\u001b[1mDefaultMaven.java:173\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.DefaultMaven.execute (\u001b[1mDefaultMaven.java:101\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.cli.MavenCli.execute (\u001b[1mMavenCli.java:827\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.cli.MavenCli.doMain (\u001b[1mMavenCli.java:272\u001b[m)
    \u001b[1mat\u001b[m org.apache.maven.cli.MavenCli.main (\u001b[1mMavenCli.java:195\u001b[m)
    \u001b[1mat\u001b[m jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (\u001b[1mNative Method\u001b[m)
    \u001b[1mat\u001b[m jdk.internal.reflect.NativeMethodAccessorImpl.invoke (\u001b[1mNativeMethodAccessorImpl.java:62\u001b[m)
    \u001b[1mat\u001b[m jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (\u001b[1mDelegatingMethodAccessorImpl.java:43\u001b[m)
    \u001b[1mat\u001b[m java.lang.reflect.Method.invoke (\u001b[1mMethod.java:566\u001b[m)
    \u001b[1mat\u001b[m org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (\u001b[1mLauncher.java:282\u001b[m)
    \u001b[1mat\u001b[m org.codehaus.plexus.classworlds.launcher.Launcher.launch (\u001b[1mLauncher.java:225\u001b[m)
    \u001b[1mat\u001b[m org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (\u001b[1mLauncher.java:406\u001b[m)
    \u001b[1mat\u001b[m org.codehaus.plexus.classworlds.launcher.Launcher.main (\u001b[1mLauncher.java:347\u001b[m)
[\u001b[1;31mERROR\u001b[m] 
[\u001b[1;31mERROR\u001b[m] Re-run Maven using the \u001b[1m-X\u001b[m switch to enable full debug logging.
[\u001b[1;31mERROR\u001b[m] 
[\u001b[1;31mERROR\u001b[m] For more information about the errors and possible solutions, please read the following articles:
[\u001b[1;31mERROR\u001b[m] \u001b[1m[Help 1]\u001b[m http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
\u001b[0m\u001b[0mcontainer 0b137519aedff271bf1d26f03bbd1597d0ffcc1fc73a87415c71fd0b7a1e9e17 is dead
Thu Nov 16 09:09:25 AM CET 2023

@yegor256
Copy link
Owner

@rultor release, tag is 0.30.0

@rultor
Copy link
Collaborator

rultor commented Nov 16, 2023

@rultor release, tag is 0.30.0

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented Nov 16, 2023

@rultor release, tag is 0.30.0

@yegor256 Done! FYI, the full log is here (took me 20min)

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

Successfully merging this pull request may close these issues.

Xembler.xml() doesn't have an option to omit the header
3 participants