Wiki source code of AgenPro Maven Plugin

Version 12.2 by Admin on 2024/02/07 22:22

Show last authors
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 (% class="auto-cursor-target" %)
29 \\
30
31 {{info}}
32 Note: Before AgenPro 5.0 the plugin group ID was com.**oosnmp**.agenpro instead now com.**agentpp**.agenpro.
33 {{/info}}
34
35 ==== SNMP4J and SNMP4J-Agent JARs ====
36
37 ===== (A) Maven Central =====
38
39 Instead manually installing SNMP4J and SNMP4J-Agent, you can also use the JARs from Maven Central:
40
41 {{code language="text"}}
42 <dependency>
43 <groupId>org.snmp4j</groupId>
44 <artifactId>snmp4j</artifactId>
45 <version>3.4.4</version>
46 <scope>compile</scope>
47 </dependency>
48 <dependency>
49 <groupId>org.snmp4j</groupId>
50 <artifactId>snmp4j-agent</artifactId>
51 <version>3.3.6</version>
52 <scope>compile</scope>
53 <exclusions>
54 <exclusion>
55 <!-- Exclude transitive dependency to SNMP4J -->
56 <groupId>org.snmp4j</groupId>
57 <artifactId>snmp4j</artifactId>
58 </exclusion>
59 </exclusions>
60 </dependency>
61 {{/code}}
62
63 (% style="color: rgb(112,112,112);" %)**(B) Manual Local Repository Installation**
64
65 [[Download>>url:http://www.snmp4j.org/html/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:
66
67 {{code}}
68 mvn install:install-file -Dfile=SNMP4J.jar -DgroupId=org.snmp4j -DartifactId=snmp4j -Dversion=3.4.4 -Dpackaging=jar -DgeneratePom=true
69
70 {{/code}}
71
72 (% class="auto-cursor-target" %)
73 \\
74
75 {{code}}
76 mvn install:install-file -Dfile=SNMP4J-Agent.jar -DgroupId=org.snmp4j -DartifactId=snmp4j-agent -Dversion=3.3.6 -Dpackaging=jar -DgeneratePom=true
77
78 {{/code}}
79
80 ==== AgenPro JAR ====
81
82 Download the [[AgenPro.jar>>url:https://www.agentpp.com/agenpro4/agenpro4.jar||shape="rect"]] file and install it into your Maven repository:
83
84 {{code}}
85 mvn install:install-file -Dfile=agenpro4.jar -DgroupId=com.agentpp -DartifactId=agenpro -Dversion=5.0.0 -Dpackaging=jar -DgeneratePom=true
86
87 {{/code}}
88
89 ==== AgenPro Maven Plugin ====
90
91 Download the [[AgenPro Maven plugin>>url:https://oosnmp.net/dist/release/com/oosnmp/agenpro/maven/plugins/agenpro-plugin||shape="rect"]] and install it into your Maven repository:
92
93 {{code}}
94 mvn install:install-file -Dfile=agenpro4-plugin.jar -DgroupId=com.agentpp -DartifactId=agenpro-plugin -Dversion=5.0.0 -Dpackaging=jar -DgeneratePom=true
95
96 {{/code}}
97
98 (% class="auto-cursor-target" %)
99 \\