Wiki source code of AgenPro Maven Plugin
Last modified by Frank Fock on 2024/05/25 21:18
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | With the AgenPro Maven plugin you can integrate the code generation into your Maven build process. | ||
2 | |||
3 | === Prerequisites === | ||
4 | |||
5 | * Maven 3.3.1 or later. | ||
6 | * AgenPro 4.2 or later. | ||
7 | |||
8 | === Installation === | ||
9 | |||
10 | ==== Maven Repository Settings ==== | ||
11 | |||
12 | Before you can start to install the AgenPro Maven Plugin you need to setup a local repository for your Maven installation and to specify a shortcut for the AgenPro Maven plugin prefix. | ||
13 | |||
14 | You can specify your Maven settings in the **settings.xml** file in the **.m2** directory within your home directory. | ||
15 | |||
16 | The **settings.xml** file should contain at least the following settings: | ||
17 | |||
18 | {{code}} | ||
19 | <settings> | ||
20 | <pluginGroups> | ||
21 | <pluginGroup>com.agentpp.agenpro.maven.plugins</pluginGroup> | ||
22 | </pluginGroups> | ||
23 | <localRepository>D:/maven/repository</localRepository> | ||
24 | </settings> | ||
25 | |||
26 | {{/code}} | ||
27 | |||
28 | {{info}} | ||
29 | Note: Before AgenPro 5.0 the plugin group ID was com.**oosnmp**.agenpro instead now com.**agentpp**.agenpro. | ||
30 | {{/info}} | ||
31 | |||
32 | ==== SNMP4J and SNMP4J-Agent JARs ==== | ||
33 | |||
34 | ===== (A) Maven Central ===== | ||
35 | |||
36 | Instead manually installing SNMP4J and SNMP4J-Agent, you can also use the JARs from Maven Central: | ||
37 | |||
38 | {{code language="none"}} | ||
39 | <dependency> | ||
40 | <groupId>org.snmp4j</groupId> | ||
41 | <artifactId>snmp4j</artifactId> | ||
42 | <version>3.4.4</version> | ||
43 | <scope>compile</scope> | ||
44 | </dependency> | ||
45 | <dependency> | ||
46 | <groupId>org.snmp4j</groupId> | ||
47 | <artifactId>snmp4j-agent</artifactId> | ||
48 | <version>3.3.6</version> | ||
49 | <scope>compile</scope> | ||
50 | <exclusions> | ||
51 | <exclusion> | ||
52 | <!-- Exclude transitive dependency to SNMP4J --> | ||
53 | <groupId>org.snmp4j</groupId> | ||
54 | <artifactId>snmp4j</artifactId> | ||
55 | </exclusion> | ||
56 | </exclusions> | ||
57 | </dependency> | ||
58 | {{/code}} | ||
59 | |||
60 | (% style="color:#707070" %)**(B) Manual Local Repository Installation** | ||
61 | |||
62 | [[Download>>http://www.agentpp.com/download.html||shape="rect"]] SNMP4J and SNMP4J-Agent ZIP files and unpack them in a local folder. Then run the following Maven commands from the **dist/lib** directories: | ||
63 | |||
64 | {{code}} | ||
65 | mvn install:install-file -Dfile=SNMP4J.jar -DgroupId=org.snmp4j -DartifactId=snmp4j -Dversion=3.4.4 -Dpackaging=jar -DgeneratePom=true | ||
66 | |||
67 | {{/code}} | ||
68 | |||
69 | |||
70 | {{code}} | ||
71 | mvn install:install-file -Dfile=SNMP4J-Agent.jar -DgroupId=org.snmp4j -DartifactId=snmp4j-agent -Dversion=3.3.6 -Dpackaging=jar -DgeneratePom=true | ||
72 | |||
73 | {{/code}} | ||
74 | |||
75 | ==== AgenPro JAR ==== | ||
76 | |||
77 | Download the AgenPro.jar file and install it into your Maven repository: | ||
78 | |||
79 | {{code}} | ||
80 | mvn install:install-file -Dfile=agenpro.jar -DgroupId=com.agentpp -DartifactId=agenpro -Dversion=5.0.0 -Dpackaging=jar -DgeneratePom=true | ||
81 | |||
82 | {{/code}} | ||
83 | |||
84 | ==== AgenPro Maven Plugin ==== | ||
85 | |||
86 | Download the [[AgenPro Maven plugin>>https://snmp.app/dist/release/com/oosnmp/agenpro/maven/plugins/agenpro-plugin||shape="rect"]] and install it into your Maven repository: | ||
87 | |||
88 | {{code}} | ||
89 | mvn install:install-file -Dfile=agenpro4-plugin.jar -DgroupId=com.agentpp -DartifactId=agenpro-plugin -Dversion=5.0.0 -Dpackaging=jar -DgeneratePom=true | ||
90 | |||
91 | {{/code}} | ||
92 | |||
93 |