lgrignon / jsweet-maven-plugin

JSweet maven plugin providing build and clean operations of JSweet sources
Apache License 2.0
18 stars 20 forks source link

Maven Install Failing for Project #43

Closed pbtura closed 6 years ago

pbtura commented 6 years ago

The most recent changes to the 2.2.0-SNAPSHOT build causes projects using the jsweet-maven-plugin to fail during the install phase.

Steps to reproduce:

  1. Create a maven project and add the jsweet-maven-plugin to the pom.

  2. Add dependencies for the jsweet-transpiler, jsweet-core, and a candy (I used bigjs).

  3. Run 'mvn clean install' on the project.

The command will fail with the error:

[ERROR] failed to create transpiler
java.util.NoSuchElementException: No value present
    at java.util.Optional.get(Optional.java:135)
    at org.jsweet.AbstractJSweetMojo.getCandiesJars(AbstractJSweetMojo.java:431)
       at org.jsweet.AbstractJSweetMojo.createJSweetTranspiler(AbstractJSweetMojo.java:204)
        ...

Debugging through the code, it looks like the problem has something to do with the way it looks up dependency jars. The filter lambda is looking for an artifact with the snapshot name (Foo-1.0.0-SNAPSHOT) but is seeing the jar with the timestamp (Foo-1.0.0-20180101.jar) and failing to match.

pbtura commented 6 years ago

Some additional context on this. It looks like the 'getCandiesJars()' method is actually bringing back ALL dependencies for the project, not just the candy jars. Is this expected behaviour? If so mabey the method should be re-named to reflect what it is actually intended to do?

lgrignon commented 6 years ago

No, it's a bug due to recent modifications. Can I use the link to your bigjsExample github and pull to have the latest modifications ?

pbtura commented 6 years ago

Not quite sure what you are looking for. You can use that project however you like, I'm just using it to experiment with.

lgrignon commented 6 years ago

I cannot reproduce but I think it depend on the local repository state. Anyway too much problem for such a minor commit of me yesterday. I reverted to make it pass fast. I guess this should be better f430463

I deployed new snapshot version. Could you please try again ?

pbtura commented 6 years ago

Seems to be working now.

lgrignon commented 6 years ago

Cool! I close then