TransformConfigurationProvider needs more maven

Splash Forums Rewrite Users TransformConfigurationProvider needs more maven

Tagged: 

This topic contains 7 replies, has 3 voices, and was last updated by  anderskristian 1 year, 6 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #26680

    anderskristian
    Participant

    I have looked at source TransformConfigurationProvider

    to make IntelliJ green I had to add dependencies:
    file: /rewrite/showcase/transform/pom.xml

    
          <dependency>
             <groupId>org.ocpsoft.rewrite</groupId>
             <artifactId>rewrite-api-servlet</artifactId>
          </dependency>
          <dependency>
             <groupId>org.ocpsoft.rewrite</groupId>
             <artifactId>rewrite-config-servlet</artifactId>
          </dependency>
    

    I can attach a patch if wanted ..

    #26681

    This should not be necessary. The project depends on rewrite-servlet which is a shaded JAR containing all required dependencies. Not sure what is wrong in your case…

    #26682

    anderskristian
    Participant

    Okay I understand that rewrite-servlet has the dependencies as nested dependencies (transitive)

    I think that the problem is inside rewrite-servlet where dependencies are scoped as “provided”.
    When I remove <scope>provided</scope> inside rewrite-servlet it works.

    I see that rewrite-servlet is designed as an “uber” jar. There is used assembly plugin etc. to generate “uber-jar” effects.
    The development tool do not understand the combination… Scope provided stops transitive dependencies and in concurrent time being inside rewrite project it self.

    The problem only exists inside rewrite maven project it self. Using rewrite-servlet.jar from client projects does NOT have the problem.

    So there are two possible solutions
    1) Ignore the situation..
    2) Add transitive dependencies where ever needed and scope them provided as well.

    #26685

    Hmmm. I’m not sure why rewrite-servlet declares provided-scoped dependencies. This doesn’t make sense to me as the shade plugin creates a “dependency-reduced pom” by removing the dependencies which are shaded. So IMHO the dependency scope should be “compile”.

    @lincoln: Any thoughts on this?

    #26787

    Ah, yes, I understand the problem. This is an IDE tooling issue. In order to work around this, you need to close the rewrite-servlet project in the IDE. Just remove or close it. It is really a build-only project. In fact, we could probably move it to a release profile in the POM so that it does not get included in the IDE workspace by default.

    #26788

    We should absolutely not change the POM files. This is just a fact of how shading works 🙂

    #26789

    anderskristian
    Participant

    I agree to keep the main idea as now.
    It works. Generation of rewrite-servlet (from maven) must work all the time. This could be less clear if we started to make rewrite-servlet in other profiles etc it could easy end up not being generated. What would cause lots of forum messages.

    It is only inside the rewrite project you can have problems.
    When I work inside the project I add dependencies like:

    
          <!-- added below inner artifact that is part of rewrite-servlet begins -->
          <dependency>
             <groupId>org.ocpsoft.rewrite</groupId>
             <artifactId>rewrite-api</artifactId>
             <scope>provided</scope>
          </dependency>
          <dependency>
             <groupId>org.ocpsoft.rewrite</groupId>
             <artifactId>rewrite-api-servlet</artifactId>
             <scope>provided</scope>
          </dependency>
          <dependency>
             <groupId>org.ocpsoft.rewrite</groupId>
             <artifactId>rewrite-config-servlet</artifactId>
             <scope>provided</scope>
          </dependency>
          <!-- added below inner artifact that is part of rewrite-servlet ends -->
    
    #26790

    anderskristian
    Participant

    (sorry duplicate)

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Comments are closed.