# Perpective Component Module Maven Build Example

**URL:** <https://forum.inductiveautomation.com/t/perpective-component-module-maven-build-example/71236>\
**Category:** Module Development\
**Tags:** perspective, ignition81\
**Created:** [March 17, 2023, 3:12pm UTC](https://forum.inductiveautomation.com/t/perpective-component-module-maven-build-example/71236 "2023-03-17T15:12:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanduri.shouri](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@kanduri.shouri](https://forum.inductiveautomation.com/u/kanduri.shouri)\
**Post date:** [March 17, 2023, 3:12pm UTC](https://forum.inductiveautomation.com/t/perpective-component-module-maven-build-example/71236/1 "2023-03-17T15:12:33Z")

</div>

Hello,

I intend to create a perspective component which contains some text fields as the input and there will be a function in the gateway scope which accepts these input from the perspective component as params to run its application.

I looked at the examples of gateway scope and perspective component from the github examples.  
The former example uses maven build while the later seems to be using gradle build tool.

I am not familiar with gradle build tool. Is there any way to build the perspective component using Maven build?  
If so could you help me with an example?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 17, 2023, 3:23pm UTC](https://forum.inductiveautomation.com/t/perpective-component-module-maven-build-example/71236/2 "2023-03-17T15:23:44Z")

</div>

I don't think the situation has changed, or will change, since Paul made this statement:

> [@Ignition 8.1.17 - after upgrading from 8.1.16, pages message sent doesn't trigger perspective message handler?](https://forum.inductiveautomation.com/t/ignition-8-1-17-after-upgrading-from-8-1-16-pages-message-sent-doesnt-trigger-perspective-message-handler/59542/8):
>
> No, there are no Maven archetypes for a Perspective component. We use Gradle internally, and no one (to my knowledge) has yet figured out how to build a Perspective component with Maven. There are two public examples of a Perspective component built using Gradle:

If you want to pioneer a path forward with Maven and share it with the community that's fine, but we don't have any examples to help you.

---

<div class="post-metadata">

**Author:** ![kanduri.shouri](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@kanduri.shouri](https://forum.inductiveautomation.com/u/kanduri.shouri)\
**Post date:** [March 17, 2023, 3:37pm UTC](https://forum.inductiveautomation.com/t/perpective-component-module-maven-build-example/71236/3 "2023-03-17T15:37:52Z")

</div>

Thanks for the information.  
Well, just another query, As i have mentioned above, the perspective component will pass the inputs as parameters to a gateway scope function and it is a single module functionality, is it that even the gateway scope should be built using gradle? i mean, should all the scopes present with the perspective component should be using gradle only?

I apologize if the question is too simple.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 17, 2023, 4:07pm UTC](https://forum.inductiveautomation.com/t/perpective-component-module-maven-build-example/71236/4 "2023-03-17T16:07:41Z")

</div>

Put directly, I'm not sure you understand what's happening well enough to even ask the right questions.

_Outside_ of Perspective, which has extra complications because it involves a different language (Java **Script** ), you're welcome to build an Ignition module in whatever JVM language you want using whatever build tool you want. @pturmel uses/used Ant, for instance. All Ignition, the platform, cares about is whether it gets a properly formatted .modl file - which is just a zip, containing .jar files with the code and dependencies you want to provide and a properly structured module.xml file.  
How you bundle your dependencies and code is entirely irrelevant to Ignition. We provide Maven and Gradle module plugins to make things easier, but they're not required.

If you want to make a scripting function (I can't really tell what you mean by "a function in the gateway scope" besides a scripting function), it's _extremely easy_ to simply copy the **code** in the scripting function example into the Perspective example. A module's gateway hook can do any number of things; it's not like there's any restriction that says a module must only do one or the other thing. We even have a Gradle-ified example of the scripting function available in a different repo: [ignition-sdk-training/scripting-function-g at main · inductiveautomation/ignition-sdk-training · GitHub](https://github.com/inductiveautomation/ignition-sdk-training/tree/main/scripting-function-g)

All **that** said, you probably don't actually need a scripting function at all? If you want your Perspective component to be able to run some arbitrary Java code on demand, you can already do that - the component model for Perspective supports arbitrary 'Delegate' registration, such that we will create an instance of a _Java_ class for you, in sync with the component lifecycle on the frontend, and expose whatever script callable methods you want, or add component message hooks that your frontend code can fire.

---

<div class="post-metadata">

**Author:** ![jimender2](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jimender2](https://forum.inductiveautomation.com/u/jimender2)\
**Post date:** [March 19, 2023, 8:59pm UTC](https://forum.inductiveautomation.com/t/perpective-component-module-maven-build-example/71236/5 "2023-03-19T20:59:43Z")

</div>

I can speak from experience, it is about 1,000,000,000 times easier to use the existing Gradle libraries than trying to convert over to using maven. I spent weeks of time in the process of converting it over to using maven but it was a headache. It was much easier to use the Gradle version.
