Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] How a maven plugin can know about m2e?

Hi,
I'd suggest against putting knowledge of m2e into maven plugin.
Instead, you could add a flag to your mojo configuration which controls the mode of operation (copying vs. pointing to m2 repo), and control it from your project's pom.xml using m2e profile.
Something along the lines of:

default value somewhere in parent pom
<properties>
  <copy-artifacts>true</copy-artifacts>
</properties>

in the plugins/pluginManagement section
<plugin>
   ...
   <configuration>
     <copy>${copy-artifacts}</copy>
   </configuration>
</plugin>


in project's pom
 <profile>
   <id>m2e</id>
   <activation>
     <property>
       <name>m2e.version</name>
     </property>
   </activation>
   <properties>
     <copy-artifacts>false</copy-artifacts>
   </properties>
 </profile>


2015-05-29 14:24 GMT+03:00 Cristiano Gavião <cvgaviao@xxxxxxxxx>:
Hello,

What is the best way for a maven plugin to know it is being run inside eclipse?

I'm looking for a way of plugin's output file to be generated different when running in or out eclipse.
More precisely, when running inside eclipse I want to generate a xml containing the location of the project's dependencies in the local repository. But when running outside I want to copy such artifacts to target folder and generate the xml pointing to those copied artifacts.

could someone give me a tip how to achieve that?

many thanks,

Cristiano



_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users



--
Regards,
Anton.

Back to the top