Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo in pom.xml leads to not being able to build Eclipse project #17

Closed
mwnorman opened this issue Apr 1, 2015 · 13 comments
Closed

typo in pom.xml leads to not being able to build Eclipse project #17

mwnorman opened this issue Apr 1, 2015 · 13 comments

Comments

@mwnorman
Copy link

mwnorman commented Apr 1, 2015

In the pom.xml hosted on Maven central, the dependency for jackson-jaxrs-providerhas a typo:

com.fasterxml.jackson.jaxrs
jackson-jaxrs-providers
^^
The artifactId should be 'jackson-jaxrs-provider' - Eclipse shows an error:
Missing artifact com.fasterxml.jackson.jaxrs:jackson-jaxrs-providers:jar:2.2.3

Could someone fix this and upload a new pom to Maven central? TIA (thanks-in-advance)

@johnmcclean
Copy link
Member

Sure, will get this fixed today.

@johnmcclean
Copy link
Member

Hi Mike,

It looks like com.fasterxml.jackson.jaxrs:jackson-jaxrs-providers:jar:2.2.3 doesn't exist because of the version. So I've upgraded the version of all jackson dependencies to 2.5.2

v0.53.2 should be available on Maven Central now.

http://search.maven.org/#artifactdetails%7Ccom.fasterxml.jackson.jaxrs%7Cjackson-jaxrs-providers%7C2.5.2%7Cpom

We use Gradle internally, so I'm guessing this issue is when you create a Maven project?

Thanks for reporting this!

John

@mwnorman
Copy link
Author

mwnorman commented Apr 2, 2015

Yes, I'm trying the create a Maven project (basically 'cause gradle support in Eclipse is .. err ... umm ... 'not-nice'
It is still dying ... the package you are referencing is a 'bundle' (package = pom) but Maven thinks it should be a jar and since Central doesn't have a jar it is complaining.

I'm guessing the 'gradle->to->pom' feature has some bugs ... I'll see if I can manually create a better pom file

@johnmcclean
Copy link
Member

I've created a test Maven project and I'm getting the same error.

Missing artifact com.fasterxml.jackson.jaxrs:jackson-jaxrs-providers:jar:2.5.2 pom.xml /tes1 line 2 Maven Dependency Problem

That's the full Gradle format of the dependency as the artifact id. Oddly enough the actual jar is present in Maven dependencies for the project.

@johnmcclean
Copy link
Member

We don't need to jaxrs:jackson-jaxrs-providers, so I'm going to remove it and rerun the build.

@johnmcclean
Copy link
Member

v0.53.3 of microserver core is up on Maven central. That seems to fix the issue for me locally. Going to push out the Spring Boot version now too.

Thanks for this Mike - really, really helpful!

@mwnorman
Copy link
Author

mwnorman commented Apr 2, 2015

Hmm ... I can't seem to find anything on Central (via search.maven.org or directly on repo1.maven.org/maven2/com/aol/microservices/microserver-core/) later than 0.53.2 :-(

@mwnorman
Copy link
Author

mwnorman commented Apr 2, 2015

Ok ... I can see it on repo1.maven.org ... hmm, still some problems:
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/OrderComparator$OrderSourceProvider
at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:200)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:126)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
at com.aol.micro.server.spring.SpringApplicationConfigurator.createSpringApp(SpringApplicationConfigurator.java:44)
at com.aol.micro.server.spring.SpringContextFactory.createSpringContext(SpringContextFactory.java:47)
at com.aol.micro.server.MicroserverApp.(MicroserverApp.java:57)
at com.windriver.simpleserver.TestMicroserverApp.main(TestMicroserverApp.java:8)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.OrderComparator$OrderSourceProvider
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

maven dependency:tree shows that while most org.springframework is coming in as 4.1.5.RELEASE, net.javacrumbs.future-converter is bringing in 'spring-core' at 4.0.3 version

Maven has the concept of a 'BOM' (Bill-Of-Materials), a 'super'-pom that binds any sub-
modules to a particular version, even if a 3rd-party asks for a different version:

At the top of your pom.xml you put:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.glassfish.jersey</groupId>
            <artifactId>jersey-bom</artifactId>
            <version>${org.glassfish.jersey-version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>${org.springframework-version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Then in the rest of the / stanzas you can add any Spring (or Jersey - I included its bom) module you want WITHOUT specifying a and auto-magically
everything will be 'leveled-up' to the version specified in

I know you are using gradle and then generating a pom from it ... do you know if it can generate a
stanza?

@johnmcclean
Copy link
Member

There is a Bill Of Materials Plugin for Gradle. Ive installed it, rebuilt it, and it seems to have removed the older versions of Spring from the generated POM.
Pushing a build out the Maven central, and will rerun the local app failing with this issue, once it arrives.

@mwnorman
Copy link
Author

mwnorman commented Apr 2, 2015

@johnmcclean
Copy link
Member

Gradle BOM plugin, didn't help - working on getting the stanzas need to be present in the generated POM.

@johnmcclean
Copy link
Member

I'll take a look at the spring plugin. It looks like the POM generation plugin doesn't transfer any Gradle exclusions, and it adds the BOM at the bottom of the Maven POM where it seems to have no effect.

We may have to migrate the entire build to Maven.

@johnmcclean
Copy link
Member

Fixed in v0.54 by removing problematic dependency. Build will have to be looked at in the medium term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants