DEV Community

Cover image for Check Out LinkedIn Maven Plugin — A Plugin to Become a Java Influencer
Antonello Zanini for Writech

Posted on • Originally published at writech.run

Check Out LinkedIn Maven Plugin — A Plugin to Become a Java Influencer

Donato Rimenti did it again! After releasing GomorraSQL and Pokedom, two projects that went viral in the IT community, he recently announced 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

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

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. To integrate LinkedIn Maven Plugin into your Java project, make sure your pom.xml file contains the following lines:

<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>
Enter fullscreen mode Exit fullscreen mode

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 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. Learn how to perform authenticated calls to LinkedIn APIs by following the official guide

In the <executions> tag, you can configure the message the plugin will post when a specific Maven task ends. This is defined in the 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..."
Enter fullscreen mode Exit fullscreen mode

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

...and it even passes all tests!
Enter fullscreen mode Exit fullscreen mode

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" appeared first on Writech.

Top comments (0)