Coder Social home page Coder Social logo

Comments (9)

searls avatar searls commented on July 24, 2024

This has been a long-suffering todo (July 2010?)--each of the jasmine maven goals explicitly binds to the appropriate lifecycle phase, but no goal depends on another goal. I too would expect jasmine:test to depend on the previous two.

Frankly I just didn't know how to do this and I never got around to finding out. If anyone knows how to make a mojo depend on a prior one, I'd gladly implement it (I hate spelling out more goals in the POM than necessary anyway).

from jasmine-maven-plugin.

thetoolman avatar thetoolman commented on July 24, 2024

Hehe ok - how about the spec ordering? I am not sure why explicitly referencing the targets would cause different output to using "mvn package" or "mvn site" - any ideas why it would behav different ?

from jasmine-maven-plugin.

thetoolman avatar thetoolman commented on July 24, 2024

Further investigation has found that it works if I explicitly call the lifecycle items that the 4 jasmine: items bind to, e.g.

mvn clean process-resources process-test-resources generate-test-resources test

But if I call it like this:

mvn jasmine:resources jasmine:testResources jasmine:test

I get my "wrong spec order" bug. I think the POM configuration properties are not being set on the mojos, meaning the defaults are being used and no order coercion happens. I think this is the case, because the "mvn jasmine:.." execution spits out this line below, even though jsSrcDir is set in the POM.

[WARNING] JavaScript source folder was expected but was not found. Set configuration property jsSrcDir to the directory containing your JavaScript sources. Skipping jasmine:resources processing.

Hope this makes sense.

from jasmine-maven-plugin.

searls avatar searls commented on July 24, 2024

Yeah, it does. I think I'd observed something similar in the past, but never chased it down.

So I think you've identified two problems:

  1. When the goals are invoked independently, they don't load custom configuration from the pom (this may suggest that the plugin short name ['jasmine:xxxx' ] was set up incorrectly).
  2. When you run the goal jasmine:test, it doesn't depend on the previous two goals, but it really should.

Both of these are officially bothering the heck out of me. Anyone reading this have any ideas of places to look to resolve it? Otherwise my next step is to go start reading the source of other plugins that don't have this problem.

from jasmine-maven-plugin.

searls avatar searls commented on July 24, 2024

I think I've finally figured this out, @thetoolman! I'm 99% sure that the reason this happens is because your (our) configuration is inside the <execution/> block. I'm currently in the middle of a pretty hefty release to the plugin, so I won't update the documentation right this minute, but it's an important thing to keep in mind.

I've posted my Q&A on stackoverflow for reference. http://stackoverflow.com/questions/6560904/why-might-my-maven-mojo-lose-its-configuration-properties-when-run-individually/6561110#6561110

from jasmine-maven-plugin.

thetoolman avatar thetoolman commented on July 24, 2024

Wooo chearleading from the sides if you have solved this bug! I'll absorb the S-O and try your new version..

from jasmine-maven-plugin.

searls avatar searls commented on July 24, 2024

@thetoolman - to be clear, I didn't change any code. I simply changed my own project's pom that looked like this:

<plugin>
   </executions>
     <execution>
       <configuration/>
     </execution>
   </executions>
</plugin>

And moved up the configuration:

<plugin>
   </executions>
     <execution>
     </execution>
   </executions>
   <configuration/>
</plugin>

from jasmine-maven-plugin.

thetoolman avatar thetoolman commented on July 24, 2024

Having now read the S-O article, I got that thanks :)

from jasmine-maven-plugin.

david-mas avatar david-mas commented on July 24, 2024

But, what if I need 2 different configurations for 2 different executions?
I wanted to run the test goal on the target, with minified resources, and the bdd goal on the src, to hot edit code and keep tests green. If there is only 1 configuration I cannot do this.
Example of what I would expect:

        <plugin>
            <groupId>com.github.searls</groupId>
            <artifactId>jasmine-maven-plugin</artifactId>
            <version>1.2.0.0</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                    <!-- set phase to after the minimisation -->
                    <phase>integration-test</phase>
                    <id>test</id>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <jsSrcDir>${project.build.directory}/${project.build.finalName}/js-lib</jsSrcDir>
                        <sourceIncludes>
                            <include>angular.min-1.0.3.js</include>
                            <include>all.js</include>
                        </sourceIncludes>
                    </configuration>
                </execution>
                <execution>
                    <id>bdd</id>
                    <goals>
                        <goal>bdd</goal>
                    </goals>
                    <configuration>
                        <jsSrcDir>${project.basedir}/src/main/webapp/js-lib</jsSrcDir>
                        <sourceIncludes>
                            <include>angular.min-1.0.3.js</include>
                            <include>all.js</include>
                        </sourceIncludes>
                    </configuration>
                </execution>
            </executions>
        </plugin>

from jasmine-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.