maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Gold <r...@gold-family.us>
Subject Re: input artifacts to plugin
Date Sun, 14 Jul 2013 02:27:59 GMT
HI Richard,

What do you want to do? If all you want is the compile dependencies:

1. Configure the plugin to require compile and runtime dependency resolution:

@Mojo( ... requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME)

2. Specify a parameter configured to receive project.compileClassElements

  /**
   * Compile classpath of the maven project.
   */
  @Parameter(defaultValue = "${project.compileClasspathElements}")
  private List<String> projectCompileClasspathElements;

On Jul 12, 2013, at 12:45 PM, Richard Sand <rsand@idfconnect.com> wrote:

> Hi all - another hopefully simple question:
> 
> Can I add a custom configuration property to my plugin which takes in the
> normal <dependencies><dependency>......</ schema used in the build? E.g.
> instead of calling mavenProject.getArtifacts() to get a Set<Artifact> for
> the build, I'd have a @Property Set<Artifact> which maven will still resolve
> & manage but specifically for use by the plugin.
> 
> As a sample, this is what I want to put into the pom.xml:
> 
> <configuration>
> 	<includedArtifacts>
> 		<includedArtifact>
> 			<groupId>com.somegroup</groupId>
> 			<artifactId>someartifact</artifactId>
> 			<version>1.0.1</version>
> 		</includedArtifact>
> 	</includedArtifacts>
> 	........
> 
> And in the plugin code:
> 
> 	/**
> 	 * Other artifacts to include in obfuscation
> 	 */
> 	@Property 
> 	Set<Artifact> includedArtifacts
> 
> This doesn't work of course - Artifact cannot be instantiated... can someone
> give me some hints for which portions of the API can help achieve what I'm
> trying to accomplish?
> 
> Another option I have is to use a Set<String> and just enter the toString
> representation of an artifact, and then look through
> mavenProject.getArtifacts() to find a match. That just seems a hack to
> require two different formats for specifying artifacts, but if it's the only
> way, so be it.
> 
> Thanks for any input!
> 
> Richard Sand | CEO
> IDF Connect, Inc. 
> 2207 Concord Ave, #359
> Wilmington | Delaware 19803 | USA 
> Office: +1 302 425 0516 | Fax: +1 856 866 1899
> Mobile: +1 267 984 3651
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

-----------------
Come read my webnovel, Take a Lemon <http://www.takealemon.com>, 
and listen to the Misfile radio play <http://www.gold-family.us/audio/misfile.html>!





Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message