Re: Project dependencies vs plugin dependencies for a mojo looking at the project

2017-09-21 Thread ahardy42
Karl Heinz Marbaise-3 wrote
>>I thought I could just enter it once as a plugin dependency in
>> the user project pom - assuming it would be the only one.
> 
> You can give this via the plugin configuration and which means your 
> plugin must resolve it's dependencies and make a required download for 
> it...which can be easily done by using a maven-artifact-transfer[3].
> 
> [3]: 
> https://maven.apache.org/shared/maven-artifact-transfer/install-project.html

I wasn't able to get the maven-artifact-transfer to function in my mojo. I
resorted to Aether's RepositorySystem.resolveArtifact() method. 




Karl Heinz Marbaise-3 wrote
 Presumably I call something like 
 project.getPlugin(key).getDependencies()?

 If the 'key' required for project.getPlugin(key) is of the form 
 myGroup:myPlugin:version e.g. com.megacorp:thing-plugin:1.0.2

 can I get my mojo's own key programmatically in the mojo to avoid 
 hard-coding it?

This is the last issue I'm facing (famous last words.)

I currently hard-code my plugin's key so I can obtain it while the mojo is
in action:

Plugin plugin = project.getPlugin("com.megacorp.stuff:my-plugin");
plugin.getDependencies()..

but I'd like to avoid that in case my successor decides to rename it or
something similar.

How can I the key programmatically, by reaching deep into the mojo?

Regards
Adam



--
Sent from: http://maven.40175.n5.nabble.com/Maven-Users-f40176.html

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Maven achetype different project name than artefactid

2017-09-21 Thread Freshmike
Hi All,

I'm trying to figure out how create a different project name than the
artifactId in eclipse when the project is generated from a maven archetype. 

we have a convention that all our apps start with app-***. Now the
artifactid is added my maven eclipse  wizard as part of the package name and
a '-' is invalid, so I'm trying to figure out how to have a different
project name vs the artifactid. 

Any tips ? 
Thanks 



--
Sent from: http://maven.40175.n5.nabble.com/Maven-Users-f40176.html

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org