Check Out LinkedIn Maven Plugin — A Plugin to Become a Java Influencer
Tags: java, programming, socialmedia, softwaredevelopment
Published: 2024-01-19 21:32:12

Donato Rimenti did it again! After releasing [GomorraSQL](https://writech.run/blog/check-out-gomorrasql-a-library-to-write-queries-in-neapolitan-3e85568dddb4) and [Pokedom](https://writech.run/blog/check-out-react-pokedom-a-library-to-catch-pok%C3%A9mon-alongside-dom-events-eb1c4f391e3c), two projects that went viral in the IT community, he recently announced [LinkedIn Maven Plugin](https://github.com/aurasphere/linkedin-maven-plugin). When configured in a Java project, this Maven plugin automatically publishes a post on LinkedIn every time you build/compile/deploy your app.

![LinkedIn Maven Plugin in action in a real LinkedIn post](https://writech.run/wp-content/uploads/2023/08/1e0Yi3uqtelCnDIBXgONcGg.png)

Let's now learn what LinkedIn Maven is, how it works, and how you can integrate it into your Java project. Time to become a LinkedIn influencer!

## The Idea Behind LinkedIn Maven Plugin

> "In #2023, can you call yourself a #fullstackdeveloper if you are not an influencer?" — Donato Rimenti

This is what Donato Rimenti stated in the original LinkedIn post to announce the project. A bold claim, of course, but backed by some solid arguments. Let's find out why.

![The original LinkedIn post to announce LinkedIn Maven Plugin](https://writech.run/wp-content/uploads/2023/08/image-47.png)

Do you really need to have a significant social media following or online presence to call yourself a skilled developer? The simple answer is "No!" Being a full-stack developer has nothing to do with the number of followers you have or the amount of content you post on social media. Instead, it is about having the skills and knowledge to write modern, well-documented, efficient code.

At the same time, considering how competitive the IT industry is, writing clean code without promoting it will not magically bring you new opportunities. This is where LinkedIn Maven Plugin comes into play!

By automatically publishing a LinkedIn post every time your code builds, compiles, or passes the tests, you can let your connections know that you have what it takes to be a good developer. This will help you prove and showcase your Java skills in real-time and with no real effort.

As Donato mentioned in his post, using the plugin can help you increase the number of contacts who recognize your Java skills and expertise. So, this is not about getting more followers on LinkedIn. It is about building a reputation as a skilled and competent developer who can consistently deliver high-quality code.

### How LinkedIn Maven Plugin Works

If you do not know how to configure a Maven plugin, first [check out the official guide](https://maven.apache.org/guides/mini/guide-configuring-plugins.html). To integrate LinkedIn Maven Plugin into your Java project, make sure your `pom.xml` file contains the following lines:

```xml
<project>
   <!-- ... -->
   <build>
      <!-- ... -->
      <plugins>
         <plugin>
            <groupId>co.aurasphere.maven.plugins</groupId>
            <artifactId>linkedin-maven-plugin</artifactId>
            <version>1.0.0</version>
            <configuration>
               <linkedinAccessToken>YOUR_LINKEDIN_ACCESS_TOKEN</linkedinAccessToken>
               <linkedinUserId>YOUR_LINKEDIN_USER_ID</linkedinUserId>
            </configuration>
            <executions>
               <execution>
                  <id>post-compile</id>
                  <phase>compile</phase>
                  <goals>
                     <goal>post</goal>
                  </goals>
                  <configuration>
                     <message>Once again, my code compiles...</message>
                  </configuration>
               </execution>
               <execution>
                  <id>post-test</id>
                  <phase>test</phase>
                  <goals>
                     <goal>post</goal>
                  </goals>
                  <configuration>
                     <message>...and it even passes all tests!</message>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <!-- ... -->
      </plugins>
   </build>
   <!-- ... -->
</project>
```

Note that the `<configuration>` tag contains the following two placeholder strings:

- `YOUR_LINKEDIN_ACCESS_TOKEN`: Replace this with your LinkedIn bearer access token. Follow the [official guide](https://learn.microsoft.com/en-us/linkedin/shared/authentication/postman-getting-started) to learn how to generate a new one.

- `YOUR_LINKEDIN_USER_ID`: Replace this with the string ID associated with your LinkedIn profile. Once you set up a LinkedIn access token, you can retrieve your user ID from the `id` field of the response returned by the [LinkedIn Profile API](https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-api). Learn how to perform authenticated calls to LinkedIn APIs by following the [official guide](https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?tabs=HTTPS1)

In the `<executions>` tag, you can configure the message the plugin will post when a specific Maven task ends. This is defined in the [](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#a-build-lifecycle-is-made-up-of-phases)tag, which accepts the following values:

- `validate`: When Maven validates that the project is correct.

- `compile`: When Maven compiles the source code of the project.

- `test`: When Maven runs the tests on the compiled source code using a suitable unit testing framework.

- `package`: When Maven takes the compiled code and packages it in a distributable format, such as a JAR.

- `verify`: When Maven runs any checks on the results of integration tests to ensure specific quality criteria are met.

- `install`: When Maven installs the generated package for use as a dependency in other projects locally.

- `deploy`: When Maven copies the final package to the remote repository for sharing with other developers and projects.

When the Maven task specified in `<phase>` completes successfully, the plugin will publish a LinkedIn post containing the content defined in `<message>`.

In the example above, if and when your Java project complies, the plugin will post a message on LinkedIn that reads:

```
"Once again, my code compiles..."
```

Then, if your code passes all tests, LinkedIn Maven Plugin will post:

```
...and it even passes all tests!
```

Et voilà! Proving your Java skills to the IT community has never been easier!

## Conclusion

In this article, you learned how important it is to let people know about your skills in a specific programming language or technology. This is how you can build a reputation as a skilled developer, and LinkedIn Maven Plugin is exactly what it is all about. This plugin automatically publishes LinkedIn posts with a customizable message when your Java code compiles, builds, and more. Use it to become a real Java influencer!

Thanks for reading! I hope you found this article helpful.
  
***
_The post "[Check Out LinkedIn Maven Plugin — A Plugin to Become a Java Influencer](https://writech.run/blog/check-out-linkedin-maven-plugin-a-plugin-to-become-a-java-influencer-598bd3fb8da7/)" appeared first on [Writech](https://writech.run)._