Every repository with this icon (
Every repository with this icon (
| Description: | Maven CLI Plugin edit |
-
atlassian-pdk:install no longer work in 0.6.8
3 comments Created 4 months ago by jollytoadHi, cli was automatically updated to 0.6.8 today, some things have stopped working.
When using cli:execute-phase, 'atlassian-pdk:install' no longer works, reporting:
[ERROR] Invalid command: atlassian-pdk:install
Although, for the time being I've discovered that I can revert to the older version with:
mvn org.twdata.maven:maven-cli-plugin:0.6.6:execute-phase
Regards
- MarkComments
-
cli-plugin doesn't display details of compilation errors
6 comments Created 7 months ago by nodjeIt's difficult to work with cli-plugin when you have compilation error.
You have to switch back to regular compilation to be able to get tyhe cause of the error.Comments
matthewmccullough
Sun Dec 20 21:53:14 -0800 2009
| link
I'm not clear about this error but need more detail. Using Maven 2.2.1 and cli plugin 1.0.1, I broke some code intentionally and executed:
mvn cli:execute-phase
mvn> compile
[INFO] Compiling 1 source file to /Users/mccm06/Documents/Temp/Scratch/test1/target/classes [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Compilation failure /Users/mccm06/Documents/Temp/Scratch/test1/src/main/java/com/ambientideas/App.java:[7,0] class or interface expected[INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.BuildFailureException: Compilation failure
/Users/mccm06/Documents/Temp/Scratch/test1/src/main/java/com/ambientideas/App.java:[7,0] class or interface expectedSomehow I can't update automatically to the latest version of Cli plugin.
Even though I don't specify version in the plugin declaration to always get the latest, I'm stuck with 0.6.9.I'll try to delete existing artifacts from our local repo to see if it updates.
I can't get the latest version.
Here is what it says after cleaning repo cache and local repo:[INFO] artifact org.twdata.maven:maven-cli-plugin: checking for updates from central Downloading: http://company:8090/artifactory/repo/org/twdata/maven/maven-cli-plugin/0.6.9/maven-cli-plugin-0.6.9.pom
7K downloaded (maven-cli-plugin-0.6.9.pom)
Downloading: http://www.laughingpanda.org/maven2/org/twdata/maven/maven-cli-plugin-parent/0.6.9/maven-cli-plugin-parent-0.6.9.pom
[INFO] Unable to find resource 'org.twdata.maven:maven-cli-plugin-parent:pom:0.6.9' in repository laughing panda (http://www.laughingpanda.org/maven2) Downloading: http://company:8090/artifactory/repo/org/twdata/maven/maven-cli-plugin-parent/0.6.9/maven-cli-plugin-parent-0.6.9.pom
4K downloaded (maven-cli-plugin-parent-0.6.9.pom)
Downloading: http://company:8090/artifactory/repo/org/twdata/maven/maven-cli-plugin/0.6.9/maven-cli-plugin-0.6.9.jar
129K downloaded (maven-cli-plugin-0.6.9.jar)It's like it can't get the right maven-metadata.xml it seems.
Any idea of what the problem could be?
matthewmccullough
Mon Dec 21 07:27:12 -0800 2009
| link
Yes. I don't see the correct plugin repo listed above. Check out the instruction page:
http://wiki.github.com/mrdon/maven-cli-pluginThe correct plugin repo is http://twdata-m2-repository.googlecode.com/svn/
Let me know if this closes this issue. I believe it will once you have version 1.0.1 of the plugin.
For some reason I had to add the to the pom to be able to get anything later than 0.6.9.
The plugin repo was correctly configured on our local Maven2 repo, Artifactory, and everything was working fine. But I couldn't get anything later than 0.6.9.
Adding the Cli plugin repo to the pom does the job. Very weird. It shouldn't be necessary to add the conf. part IMHO.
And btw, yes, you can close the bug, it works fine now!
cheers
matthewmccullough
Mon Dec 21 19:44:46 -0800 2009
| link
That's really odd indeed. I don't have the plugin defined in any of my poms, yet I'm using 1.0.1 across a plethora of projects at home and at work. I just have it added to my settings.xml in one location and to my nexus repo proxies in another. Sorry that part is giving you trouble but I'm glad the features, stability, and bug-killing are all improving in the latest version!
-
User properties cannot be overriden using cli:execute-phase
11 comments Created 7 months ago by jcarsiqueSetting properties through command line or cli console doesn't work (-Dproperty=value).
A workaround would be to define a profile per property group to set but it doesn't cover all needs.
Version tested is 0.6.3.CR2.Comments
mojavelinux
Tue May 05 06:46:36 -0700 2009
| link
Please note that 0.6.3.CR2 is a version hosted at the JBoss Maven repository from my fork: http://github.com/mojavelinux/maven-cli-plugin/tree
mojavelinux
Tue May 05 06:39:07 -0700 2009
| link
Are you having a problem with execute or execute-phase? I'm pretty sure properties work in execute-phase.
mojavelinux
Tue May 05 06:50:42 -0700 2009
| link
You can verify by running the following in the console:
org.apache.maven.plugins:maven-help-plugin:evaluate
Then you have to type an expression, such as ${myproperty}. You'll have to deal with the lack of echo (what you type won't be shown), the press enter. The value will be outputted.
Hello,
It's with the execute-phase, still on 0.6.3.CR2 (should I use another version and deploy it into our own maven repositories) ?
The error with properties happens with already defined properties, they cannot be overridden.
To reproduce:
- define a "prop" property with value "oldvalue" in your pom - test1:mvn cli:execute-phase -Dprop=newvalue org.apache.maven.plugins:maven-help-plugin:evaluate gives "oldvalue"- test2: mvn cli:execute-phase org.apache.maven.plugins:maven-help-plugin:evaluate -Dprop=newvalue gives "oldvalue" Thanks,
mojavelinux
Tue May 05 08:17:48 -0700 2009
| link
Ah, so that is the error report. That you cannot override properties, not that they don't work. I think this may actually be a problem in Maven, but don't hold me to that.
Sorry for title, that was what I meant by "user properties" versus "properties defined by default" (i just updated this issue title).
I don't have this issue with maven, the same properties are correctly overridden from command line. Do you mean the new properties' values are evaluated at a moment in maven execution process that your plugin cannot use ?
I effectively saw a lot of maven bugs about properties some years ago, do you rely on old maven api ?
mojavelinux
Tue May 05 08:23:57 -0700 2009
| link
It does use the Maven Embedder which by chance has some legacy issues. It could be a simple as just not adding the property correctly in the command line parser. I'll dig into it. I'm sure we can get it fixed up. Thanks for reporting this.
mojavelinux
Tue May 05 10:04:55 -0700 2009
| link
I did some digging. This appears to be an error deep down in Maven 2.0.x. Basically, when you run the following code:
session.getExecutionProperties().putAll(commandCall.getProperties());
project.getProperties().putAll(commandCall.getProperties());
MavenExecutionRequest request = new DefaultMavenExecutionRequest(
session.getLocalRepository(), session.getSettings(), session.getEventDispatcher(), commandCall.getCommands(), userDir.getPath(), profileManager, session.getExecutionProperties(), project.getProperties(), true);Properties props = ((DefaultMaven) embeddedMaven).getProject(new File("pom.xml"), request).getProperties();
The properties returned are those in the pom.xml. The properties assigned to the request object, either userProperties or session executionProperties do not override the values from the pom.xml. What's interesting is that the profile manager does see the properties, so the properties specified using -D can activate a profile.
I'm not sure how to fix this. Following Maven through its labyrinth gets really hairy...but at least we know what we are looking for. The return value of getProject() (which is deep inside of execute()), must show the properties as overridden. Otherwise, it won't work.
mojavelinux
Wed May 06 22:05:17 -0700 2009
| link
I am now 100% sure this is a bug in Maven 2.0 (specifically tested with 2.0.8 - 2.0.10). It has been resolved in Maven 2.1. I verified I can run this plugin under 2.1 (with a slight hack I mention elsewhere) and the properties can be overridden. So unfortunately, there is nothing the plugin can do to solve the problem in Maven 2.0.
Understood. What a pity our project are not compatible with Maven 2.1 for now. Congratulations and many thanks for your deep inspection into Maven labyrinth code. Maybe they could do some backport to fix this issue on 2.0. For now, I'll have to manage properties with profiles in order to use your nice plugin until we're able to use Maven 2.1. Thanks again.
matthewmccullough
Sun Dec 20 21:41:24 -0800 2009
| link
Fixed in Maven 2.1 core based on investigation by mojavelinux
-
profiles are not activated for cli:execute-phase
4 comments Created 8 months ago by mojavelinuxIt appear that the cli:execute-phase don't activate profiles that are passed in from the command line. This is unfortunate because it means I cannot leverage this plugin for scenarios such as deployment that rely on other plugins and dependencies specified in a profile.
I'm looking for something like:
bash$ cli:execute-phase -Prun-integration-tests
maven2> testYou can easily verify that profiles are not activated by examining the output of help:effective-pom once in the command console. When I run tests, the run-integration-tests configuration does not take affect.
Comments
matthewmccullough
Mon May 04 14:41:29 -0700 2009
| link
I'll try to take a look at this here in the next few weeks.
mojavelinux
Tue May 05 06:51:28 -0700 2009
| link
Please see my fork. I've solved the problems I mention and more (such as the ability to activate a profile explicitly).
matthewmccullough
Tue May 05 07:34:57 -0700 2009
| link
Okay. Will do. Awesome!
matthewmccullough
Sun Dec 20 21:53:43 -0800 2009
| link
Fixed by mojavelinux in May of 2009
-
unable to run resources:testResources from cli context
2 comments Created 8 months ago by nodjeIt seems the goal testResources is missing from the cli context.
Or at least I'm unable to trigger it.The following goal chain should be enough to run the test, but it fials inmy case because test resources aren't copied:
resources compile testCompile test
Shouldn't be enough to run the test? Or should a testResources goal be introduced?
Comments
mojavelinux
Tue May 05 10:11:33 -0700 2009
| link
The following line should be added to the defaultAliases map of ExecuteCliMojo:
put("testResources", "org.apache.maven.plugins:maven-resources-plugin:testResources");
As a workaround, you can just spell out the command:
org.apache.maven.plugins:maven-resources-plugin:testResources
matthewmccullough
Sun Dec 20 21:55:26 -0800 2009
| link
Tested in cli plugin 1.0.1
mvn cli:execute
maven2> testResources
[INFO] Executing: org.apache.maven.plugins:maven-resources-plugin [testResources] [INFO] [resources:testResources {execution: default-testResources}] [WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/mccm06/Documents/Temp/Scratch/test1/src/test/resources [INFO] Current project: test1 [INFO] Execution time: 1009 msSUCCESS












Noted, and I'm looking into it.
The bug is fixed, waiting for Matt to pull the patch into the master tree.
Pulled and and deployed as 0.6.9