Re: maven plugin with an XML configuration

2008-12-14 Thread clement escoffier
Hi,

Thanks for your reply.

CDATA sounds good for my case. How I can configure the plugin to read the
XML configuration as CDATA ?

Thanks in advance,

Regards,

Clement

2008/12/11 Brett Porter br...@apache.org

 You could use DOM and convert it to a string in the plugin, but that means
 that you have to use a DOM object :)

 Other than that, I think you need to wrap it in a CDATA.

 Plexus has no internal converter for turning a DOM into a string at the
 moment.

 - Brett


 On 11/12/2008, at 9:17 PM, clement escoffier wrote:

  Hello,

 I'm developing a maven plugin with a configuration containing an XML
 String.
 However, I would like to get it as a regular String. In my context it is
 not
 possible to use DOM objects as the content undetermined.

 Here is an example of such configuration:

 configuration
   meta
   component
 classname=org.apache.felix.ipojo.arch.ArchCommandImpl
public=false
   Provides /
   requires field=m_archs optional=true /
   requires field=m_handlers optional=true/
   /component
   /meta
 /configuration

 Is it possible to get the meta parameter as a regular String ?

 Best regards,

 Clement


 --
 Brett Porter
 br...@apache.org
 http://blogs.exist.com/bporter/


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




maven plugin with an XML configuration

2008-12-11 Thread clement escoffier
Hello,

I'm developing a maven plugin with a configuration containing an XML String.
However, I would like to get it as a regular String. In my context it is not
possible to use DOM objects as the content undetermined.

Here is an example of such configuration:

configuration
meta
component
classname=org.apache.felix.ipojo.arch.ArchCommandImpl
 public=false
Provides /
requires field=m_archs optional=true /
requires field=m_handlers optional=true/
/component
/meta
/configuration

Is it possible to get the meta parameter as a regular String ?

Best regards,

Clement


Problem when solving dependencies in install-file phase

2007-06-21 Thread Clement Escoffier

Hello,


We are implementing a Maven plugin to transform Maven repositories into 
OSGi Bundle Repository (OBR). This plugin provides several phase as :

- install
- install:install-file
- deploy
- deploy:deploy-file

Install  Deploy work fine, however we have issues on install-file and 
deploy-file.


So I execute it with :
mvn install:install-file 
org.apache.felix:maven-bundle-plugin:install-file -Dfile=o.a.f.xxx.jar 
-DartifactId=xxx -DgroupId=test -Dversion=0.7.7 -Dpackaging=jar


For a strange reason, when we execute this command, Maven try to solve 
plugin dependencies. But instead of resolving dependencies normally 
(as desbribe in the plugin pom file), it looks for artifacts inside the 
'test' groupId (and sometimes with a bad version number, 0.7.7 instead 
of the specified version).


For example, my plugin pom file contains a dependency on org.osgi core :
...
dependency
groupIdorg.apache.felix/groupId
artifactIdorg.osgi.core/artifactId
version0.9.0-incubator-SNAPSHOT/version
/dependency
...

However,at runtime, Maven looks for org.osgi.core inside the 
org.apache.felix.tools groupId instead of org.apache.felix, and of the 
0.7.7  :



C:\projet\Stagemvn install:install-file 
org.apache.felix.tools:maven-bundle-plugin:install-file 
-Dfile=org.apache.felix.ipojo-0.7.1
-incubator-SNAPSHOT.jar -DartifactId=ipojo -DgroupId=test 
-Dversion=0.7.7 -Dpackaging=jar

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] 


[INFO] Building Unnamed - tools:ipojo:jar:0.7.1
[INFO]task-segment: [install:install-file] (aggregator-style)
[INFO] 


[INFO] [install:install-file]
[INFO] Installing 
C:\projet\Stage\org.apache.felix.ipojo-0.7.1-incubator-SNAPSHOT.jar to 
C:\projet\Stage\mvn_r

epo\test\ipojo\0.7.7\ipojo-0.7.7.jar
[INFO] 


[INFO] Building Unnamed - tools:ipojo:jar:0.7.1
[INFO]task-segment: [homega.tools:obrPlugin:repository ]
[INFO] 

Downloading: 
http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.pom 
http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.pom
Downloading: 
http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.pom
Downloading: 
http://repo1.maven.org/maven2/test/org.apache.felix.shell/0.7.7/org.apache.felix.shell-0.7.7.pom
Downloading: 
http://repo1.maven.org/maven2/test/org.apache.felix.shell/0.7.7/org.apache.felix.shell-0.7.7.pom
Downloading: 
http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.jar 
http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.jar
Downloading: 
http://repo1.maven.org/maven2/test/org.apache.felix.shell/0.7.7/org.apache.felix.shell-0.7.7.jar 
http://repo1.maven.org/maven2/test/org.apache.felix.shell/0.7.7/org.apache.felix.shell-0.7.7.jar
[INFO] 


[ERROR] BUILD ERROR
[INFO] 


[INFO] Failed to resolve artifact.

Missing:
--
1) test:org.osgi.core:jar:0.7.7
 Try downloading the file manually from the project website.
 Then, install it using the command:
 mvn install:install-file -DgroupId=test -DartifactId=org.osgi.core \
 -Dversion=0.7.7 -Dpackaging=jar -Dfile=/path/to/file
 Path to dependency:
   1) org.apache.felix:maven-bundle-plugin:maven-plugin:1.0.0
   2) 
org.apache.felix:org.apache.felix.shell:jar:0.9.0-incubator-SNAPSHOT

   3) test:org.osgi.core:jar:0.7.7

2) test:org.apache.felix.shell:jar:0.7.7
 Try downloading the file manually from the project website.
 Then, install it using the command:
 mvn install:install-file -DgroupId=test 
-DartifactId=org.apache.felix.shell \

 -Dversion=0.7.7 -Dpackaging=jar -Dfile=/path/to/file
 Path to dependency:
   1) homega.tools:obrPlugin:maven-plugin:1.0.0
   2) 
org.apache.felix:org.apache.felix.bundlerepository:jar:0.9.0-incubator-SNAPSHOT

   3) test:org.apache.felix.shell:jar:0.7.7
--
2 required artifacts are missing. 

So, I don't understand why Maven resolves the dependencies as described. 
How can we fix this problem ?


Thank you for your response.

Regards,

Clement



Wrong artifactHandler

2006-09-27 Thread Clement Escoffier

Hello,

I am a strange problem with a plugin that I develop. This plugin do a 
bytecode manipulation of java classes during the packaging of the 
artifact. It works with simple project (non multi-module).


Nevertheless, when I use my plugin inside a multi-module project, Maven 
does not use the good artifact handler. To trace the problem, I modify 
the install-plugin to display some info after the installation. To check 
the ArtifactHandler, I set the language to foo inside my plugin :

component
 roleorg.apache.maven.artifact.handler.ArtifactHandler/role
 role-hintipojo-bundle/role-hint
 
implementationorg.apache.maven.artifact.handler.DefaultArtifactHandler/implementation

 configuration
   typeipojo-bundle/type
   includesDependenciestrue/includesDependencies
   languagefoo/language
   extensionjar/extension
   addedToClasspathtrue/addedToClasspath
 /configuration
/component

When I launch mvn clean install on the single project I have the 
following result :

...
[INFO] [install:install]
[INFO] Installing 
F:\workspaces\Felix\ipojo.arch\target\org.apache.felix.ipojo.arch-0.6.0-SNAPSHOT.jar 
to 
F:\mvn_repository\org\apache\felix\org.apache.felix.ipojo.arch\0.6.0-SNAPSHOT\org.apache.felix.ipojo.arch-0.6.0-SNAPSHOT.jar

Artifact Type : ipojo-bundle
Packaging : ipojo-bundle
Language : foo
Artifact Handler Extension : jar
Artifact Handler Packaging : ipojo-bundle

So, it works in this case.

But when I launch mvn clean install on the multi module project, the I 
have the following (strange) result :
[INFO] Installing 
f:\workspaces\Felix\ipojo.arch\target\org.apache.felix.ipojo.arch-0.6.0-SNAPSHOT.jar 
to 
F:\mvn_repository\org\apache\felix\org.apache.felix.ipojo.arch\0.6.0-SNAPSHOT\org.apache.felix.ipojo.arch-0.6.0-SNAPSHOT.ipojo-bundle

Artifact Type : ipojo-bundle
Packaging : ipojo-bundle
Language : none
Artifact Handler Extension : ipojo-bundle
Artifact Handler Packaging : ipojo-bundle

So, I think that when used in multi-module Maven does not use the good 
artifact handler. But how I can solve this problem ?


Thank you very much for all ideas

Clement Escoffier

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



Re: Wrong artifactHandler

2006-09-27 Thread Clement Escoffier

dan tran a écrit :

add your vote  to this jira http://jira.codehaus.org/browse/MNG-1682

in the mean while, have you tried setting your packaging extension as 
jar?

Yes I do, but it does not work.




-D

On 9/27/06, Clement Escoffier [EMAIL PROTECTED] wrote:


Hello,

I am a strange problem with a plugin that I develop. This plugin do a
bytecode manipulation of java classes during the packaging of the
artifact. It works with simple project (non multi-module).

Nevertheless, when I use my plugin inside a multi-module project, Maven
does not use the good artifact handler. To trace the problem, I modify
the install-plugin to display some info after the installation. To check
the ArtifactHandler, I set the language to foo inside my plugin :
component
 roleorg.apache.maven.artifact.handler.ArtifactHandler/role
 role-hintipojo-bundle/role-hint

implementationorg.apache.maven.artifact.handler.DefaultArtifactHandler
/implementation
 configuration
   typeipojo-bundle/type
   includesDependenciestrue/includesDependencies
   languagefoo/language
   extensionjar/extension
   addedToClasspathtrue/addedToClasspath
 /configuration
/component

When I launch mvn clean install on the single project I have the
following result :
...
[INFO] [install:install]
[INFO] Installing
F:\workspaces\Felix\ipojo.arch\target\org.apache.felix.ipojo.arch-
0.6.0-SNAPSHOT.jar
to

F:\mvn_repository\org\apache\felix\org.apache.felix.ipojo.arch\0.6.0-SNAPSHOT\org.apache.felix.ipojo.arch- 


0.6.0-SNAPSHOT.jar
Artifact Type : ipojo-bundle
Packaging : ipojo-bundle
Language : foo
Artifact Handler Extension : jar
Artifact Handler Packaging : ipojo-bundle

So, it works in this case.

But when I launch mvn clean install on the multi module project, the I
have the following (strange) result :
[INFO] Installing
f:\workspaces\Felix\ipojo.arch\target\org.apache.felix.ipojo.arch-
0.6.0-SNAPSHOT.jar
to

F:\mvn_repository\org\apache\felix\org.apache.felix.ipojo.arch\0.6.0-SNAPSHOT\org.apache.felix.ipojo.arch- 


0.6.0-SNAPSHOT.ipojo-bundle
Artifact Type : ipojo-bundle
Packaging : ipojo-bundle
Language : none
Artifact Handler Extension : ipojo-bundle
Artifact Handler Packaging : ipojo-bundle

So, I think that when used in multi-module Maven does not use the good
artifact handler. But how I can solve this problem ?

Thank you very much for all ideas

Clement Escoffier

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







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



How to fix artifact extension in multi-module project

2006-09-15 Thread Clement Escoffier

Hello,

I have a maven plugin packaging a project as a OSGi bundle. The plugin 
works when calling on a single project, but sometimes in multi-module 
project the installed artifact has a wrong extension (osgi-bundle 
instead of jar).


The problem occurs when I have different module packaged with different 
plugins.


How I can fix this problem ?

Thanks you very much

Clement

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