4

I'm trying to modify tesla-profiler extension to support different output formats as well as to choose the path where to write the file.

My current components.xml defines a "renderer" with a specific implementation that is required by the profiler and selected by role-hint, but it's completelly static now, it looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<component-set>
  <components>
    <component>
      <role>io.tesla.lifecycle.profiler.SessionProfileRenderer</role>
      <role-hint>file-writer</role-hint>
      <implementation>io.tesla.lifecycle.profiler.SessionProfileFileWriter</implementation>
      <configuration>
        <filename>profile.out</filename>
      </configuration>
    </component>
    <component>
      <role>org.apache.maven.eventspy.EventSpy</role>
      <role-hint>tesla-profiler</role-hint>
      <implementation>io.tesla.lifecycle.profiler.LifecycleProfiler</implementation>
      <isolated-realm>false</isolated-realm>
      <requirements>
        <requirement>
          <role>io.tesla.lifecycle.profiler.SessionProfileRenderer</role>
          <role-hint>file-writer</role-hint>
        </requirement>
      </requirements>
    </component>
  </components>
</component-set>

I'd like to know if I could parametrize or override it somehow so I can select from a project's pom.xml the SessionProfileRenderer to use and maybe also the parameters for the renderer, e.g. the path of the file to write in the SessionProfileFileWriter.

Jaime Soriano
  • 7,309
  • 2
  • 33
  • 45
  • possible duplicate of [Overriding 'clean' lifecycle in Maven](http://stackoverflow.com/questions/5171950/overriding-clean-lifecycle-in-maven) – Paul Sweatte Aug 26 '15 at 18:00

0 Answers0