olensmar / serverless4j

Collection of serverless-related tools and libraries for Java
Apache License 2.0
3 stars 2 forks source link

Artifact No Longer Found #1

Closed laijow96 closed 5 years ago

laijow96 commented 5 years ago

I think that on Maven

   <dependency>
        <groupId>io.nanoservices</groupId>
        <artifactId>serverless-annotations</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>

This dependency in the plugin maven does not exist anymore, currently the version is a 1.0-alpha-1. I was wondering how we would remedy this issue currently.

Error that I get when I try to run "mvn serverless:generate" is

Could not resolve dependencies for project com.saic.serverlesslogin:serverlesslogin:jar:1.0-SNAPSHOT: Could not find artifact io.nanoservices:serverless-annotations:jar:1.0-SNAPSHOT

I believe it has to do with the version value because on the maven repo, it is listed as 1.0-alpha-1. How might I fix this?

olensmar commented 5 years ago

Hi!

hm... and what happens if you simply change the version to 1.0-alpha-1 in your dependency!?

/Ole

olensmar commented 5 years ago

I've updated the README in this regard - it should have shown the 1.0-alpha-1 version anyway

laijow96 commented 5 years ago

Hey Ole!

It's great to hear from you. So it seems like I'm still running into the issue despite changing the dependency to the above 1.0-alpha-1 version.

Could this be due to the pom.xml of the maven plugin having the dependency with version 1.0-SNAPSHOT? Or am I using the plugin incorrectly? Once I plug in the values in my POM, I try to run "mvn serverless:generate" in order to get the serverless yaml to be created, I get the "Could not find artifact..." error.

Referencing: https://github.com/olensmar/serverless4j/blob/next/maven-plugin/pom.xml#L86

olensmar commented 5 years ago

yes - you're right - my bad - I'll have to update the dependency correctly for alpha-2.. :-(

Please try this: add the maven plugin as a regular dependency but exclude the annotations

<dependencies>
...
   <dependency>
            <groupId>io.nanoservices</groupId>
            <artifactId>serverless-annotations</artifactId>
            <version>1.0-alpha-1</version>
            <exclusions>
                <exclusion>
                    <groupId>io.nanoservices</groupId>
                    <artifactId>serverless-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
</dependencies>

Then add the right dependency in your plugins section:

 <build>
        <plugins>
            <plugin>
                <groupId>io.nanoservices</groupId>
                <artifactId>serverless-maven-plugin</artifactId>
                <version>1.0-alpha-1</version>
                <dependencies>
                    <dependency>
                        <groupId>io.nanoservices</groupId>
                        <artifactId>serverless-annotations</artifactId>
                        <version>1.0-alpha-1</version>
                    </dependency>
                </dependencies>

                <configuration>
             ...

Does that work for now?

laijow96 commented 5 years ago

It works now and builds correctly! Thank you for the help and quick responses.

olensmar commented 5 years ago

Great! please don't hesitate to open more issues/requests/etc!