ProjectFile
activator to account for changes to files and then use the ProjectVersion
activator to select all source code modules along with the results of the already calculated metric, instead of going through the project's file tree on every revision. mvn archetype:generate -DgroupId=your.package -DartifactId=pluginname -Dversion=0.x #(replace x with your plug-in's version) -Dpackage=your.package.pluginname -DarchetypeGroupId=eu.sqooss.metrics -DarchetypeArtifactId=archetype -DarchetypeVersion=1.0
pom.xml
file in the <modules>
section, if the archetype creator does not do that for you<modules> ... <module>pluginame</module> ... </modules>
<name>
tag to something meaningful<version>
tag to something meaningful<instuctions>....</instructions>
section of the file, change the included tags to match your plug-in's details. Important is to set the Bundle-Activator
parameter to your bundle's activator class, otherwise the plug-in will fail to start. The above steps should produce a basic plug-in that builds, loads and can be installed. Of course, it does nothing useful.
If your plug-in uses a custom table to store results, then it must provide its own data access objects and configuration files (JPA annotations do not work). Hibernate mapping files are called *.hbm.xml
and by convention live in the same package as the Java files that define the data access objects. Alitheia Core poses the additional restriction that the private database table sources (Java and Hibernate) live in a package named db
, so the .hbm.xml
files should be placed in a directory like:
eu/sqooss/metrics/your/plugin/package/db
<plugins>....</plugins>
section of the generated pom.xml
file.<resources> <resource> <targetPath>eu/sqooss/service/db</targetPath> <directory>src/main/java/${groupId}/${artifactId}/db</directory> <includes> <include>**/*.xml</include> </includes> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*</include> </includes> </resource> </resources>
<instuctions>
section<Import-Package>*, eu.sqooss.metrics.db.*</Import-Package>