Question

I am learning Apache Sling, Apache felix , OSGI these days. Whenever I run command mvn clean install. After building any project. It shows one warning. Can you tell me the reason behind this?enter image description here

I am implementing this tutorial.

At 25th line in pom.xml ,I added these lines.

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <source>1.5</source>
            <target>1.5</target>
        </configuration>
    </plugin>

Edited

What is the difference between dependency and plugin?

Was it helpful?

Solution

You should add a version to your plugin to make the build reliable (otherwise things maybe will change if maven fetches a never version and uses this in the future)

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.0</version>
    <configuration>
        <source>1.5</source>
        <target>1.5</target>
    </configuration>
</plugin>

OTHER TIPS

Add version in your plugin definition:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.0</version>
    <configuration>
        <source>1.5</source>
        <target>1.5</target>
    </configuration>
</plugin>

The warning is about the plugin version, not its configuration.

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.0</version>
        <configuration>
            <source>1.5</source>
            <target>1.5</target>
        </configuration>
      </plugin>

@jhamb As you want to create a bundle you need to change the packaging type to bundle not pom. I think this will solve your problem and also add the maven bundle plugin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top