Closed tribbloid closed 6 years ago
1) released 1.1.20171204015648
2) may I ask which projects will you release with this?
Thanks a lot! The project is https://github.com/tribbloid/spookystuff, version number is 0.4.0
Just test it, the flattened pom file looks good to me. However there are 2 issues that may affects its usability:
The pom.xml file in the jar/META-INF is still the unflattened version (mojohaus version use the flattened version automatically), not sure of the impact though as META-INF should be ignored by most package manager
The flattened pom.xml will be ignored by maven-install-plugin! This definitely has negative impact if one use local .m2 repository extensively (shouldn't affect remote or staging). Maybe we'll have to submit a patch to maven-install-plugin as well. Hopefully this won't become a cluster of mess.
META-INF
: will take a look
install:install
: actually works, by default, see integration test:
https://github.com/random-maven/flatten-maven-plugin/blob/master/src/it/test-1/pom.xml
[INFO] [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ flatten-maven-plugin-test-1 ---
[INFO] [INFO] Installing /home/work/source/git/flatten-maven-plugin/target/it/test-1/target/flatten-maven-plugin-test-1-0.20171204203052.jar to /home/work/repository/maven/com/carrotgarden/maven/flatten-maven-plugin-test-1/0.20171204203052/flatten-maven-plugin-test-1-0.20171204203052.jar
[INFO] [INFO] Installing /home/work/source/git/flatten-maven-plugin/target/it/test-1/pom.xml.flatten to /home/work/repository/maven/com/carrotgarden/maven/flatten-maven-plugin-test-1/0.20171204203052/flatten-maven-plugin-test-1-0.20171204203052.pom
[INFO] [INFO]
make sure flatten:flatten
(by default bound to phase=package
) is in fact before phase=install
I didn't see
Also, I'm sorry I wasn't very specific about how maven-install-plugin malfunctions in this case:
It will select the right jar artifact and generate the right project pom file, but install into the wrong location, e.g. in your test-2 it will likely install into:
.m2/repository/com/carrotgarden/a/carrot-a/0-SNAPSHOT
instead of the correct:
.m2/repository/com/carrotgarden/a/carrot-a_2.12/0-SNAPSHOT
got it, will take a look
just tried locally:
maven-install is fixed, but now attach-sources and attach-javadoc are broken:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:2.4:jar (attach-sources) on project spookystuff-mldsl_2.10: Execution attach-sources of goal org.apache.maven.plugins:maven-source-plugin:2.4:jar failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-source-plugin:2.4:jar (attach-sources) on project spookystuff-mldsl_2.10: Execution attach-sources of goal org.apache.maven.plugins:maven-source-plugin:2.4:jar failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
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)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution attach-sources of goal org.apache.maven.plugins:maven-source-plugin:2.4:jar failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:145)
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)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: java.lang.NullPointerException
at org.apache.maven.project.artifact.AttachedArtifact.getVersion (AttachedArtifact.java:138)
at org.apache.maven.artifact.DefaultArtifact.validateIdentity (DefaultArtifact.java:148)
at org.apache.maven.artifact.DefaultArtifact.<init> (DefaultArtifact.java:123)
at org.apache.maven.project.artifact.AttachedArtifact.<init> (AttachedArtifact.java:49)
at org.apache.maven.project.DefaultMavenProjectHelper.attachArtifact (DefaultMavenProjectHelper.java:60)
at org.apache.maven.plugin.source.AbstractSourceJarMojo.packageSources (AbstractSourceJarMojo.java:316)
at org.apache.maven.plugin.source.AbstractSourceJarMojo.packageSources (AbstractSourceJarMojo.java:247)
at org.apache.maven.plugin.source.AbstractSourceJarMojo.execute (AbstractSourceJarMojo.java:216)
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)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
I speculate that it was caused by 'defaultPhase = LifecyclePhase.PREPARE_PACKAGE', probably there is a reason mojohaus version use 'GENERATE_RESOURCES'.
Also, would you mind adding (or adapting) the old integration test of mojohaus version that use assertions? This is to ensure backward compatibility, its too easy to make mistake on java open source project.
ok: another fix https://github.com/random-maven/flatten-maven-plugin/commit/b88cbe635d0d76d195f8a7a2324597b627ae3402#diff-5ec98d8e02ab5ef60a25cb00167e5de4 another try https://bintray.com/random-maven/maven/flatten-maven-plugin/1.2.20171205085950
integration test: yes, later
here is performOverrideIdentity
test
https://github.com/random-maven/flatten-maven-plugin/blob/master/src/it/test-2/verify.groovy
@Andrei-Pozolotin Looks all good! Though my project probably doesn't use enough third-party plugins to be objective enough. You may need other people to test all edge cases. Highly recommended to publish to maven central ASAP.
Just found one small problem: it will mess with reactor build order. This is really hard to fix and probably doesn't worth the effort.
you mean: override identity?
you can impose order via modules and depend on explicit scala identity: https://github.com/random-maven/flatten-maven-plugin/tree/master/src/it/test-3
Not if part of the submodules are optional through profile. Reactor build sequence was created for this case.
please close this if release is success
Oh, sure, sorry about that :)
The released version is still:
Which excludes features merged at Dec. 1 for scala cross-compilation.
Any plan to release it on maven central? The release of one of my scala project depends on it.