Sorry this was a stupid user error.  Turned out I had the plugin defined
twice in my build section, and the first one seems to be the one that
wins (and of course, I had been modifying the second one).

I basically have this working now, but I still have a problem with array
properties in the referenced object.  I'll address that in another mail.

Again, sorry for my confusion here.

John Wells (Aziz)
[EMAIL PROTECTED]


-----Original Message-----
From: John Wells 
Sent: Tuesday, January 10, 2006 10:17 AM
To: 'Maven Users List'
Subject: Trying to write a java packaging mojo but...

I have a simple packaging mojo (that extends AbstractMojo).  It is
attempting to override the "package" phase with something that does
special stuff with the manifest file. (Later, it will also do something
with the IT phase).


My mojo file has something like this:

/**
 * @parameter
 * @required
 */
private OsgiManifest osgiManifest;

Inside the OsgiManifest.java file is the following:

/**
 * @parameter
 */
private String name;

...

public void setName(String name) { this.name = name; }
public String getName() { return name; }

Now, inside the pom of another project that uses this new packaging I
put:

<plugin>
  ...
  <configuration>
    <osgiManifest>
      <name>Foo</name>
    </osgiManifest>
  </configuration>
</plugin>

However, I get an error:

[INFO] One or more required plugin parameters are invalid/missing for
'osgi-bund
ler:osgi-bundle'

[0] inside the definition for plugin: 'maven-osgi-bundler-plugin'specify
the fol
lowing:

<configuration>
  ...
  <osgiManifest>VALUE</osgiManifest>
</configuration>.


What magic thing am I getting wrong?  I *have* a osgiManifest element
inside the configuration for the plugin.  I've put the configuration
inside an execution with the proper phase and goals, but that doesn't
work either.  I've put other properties inside the configuration (simple
ones - Strings etc) which *do* get filled in (which seems to tell me I
am putting the "configuration" element in the correct place.

Furthermore, if instead I use something like this:

/**
 * @parameter expression="${com.bea.core.maven2.plugins.OsgiManifest}"
 */
private OsgiManifest osgiManifest;

Then the osgiManifest is properly initialized, but it does *not* pick up
any parameters from the pom file of the project using the packaging.

Any help, as always, is appreciated.

John Wells (Aziz)
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to