jFastCGI / jfastcgi

jFastCGI
Other
38 stars 11 forks source link

Three changes: Some Maven things, CONTENT_TYPE and some more allowed HTTP headers. #26

Closed jm009 closed 6 years ago

jm009 commented 6 years ago

1) Maven:

a) Get rid of warnings like

[WARNING] [WARNING] Some problems were encountered while building the effective model for org.jfastcgi.parent:jfastcgi-parent:pom:2.4-SNAPSHOT [WARNING] 'parent.relativePath' of POM org.jfastcgi.parent:jfastcgi-parent:2.4-SNAPSHOT (/home/xxx/dev/git/jfastcgi/parent/pom.xml) points at org.jfastcgi.parent:jfastcgi-build instead of org.sonatype.oss:oss-parent, please verify your project structure @ line 4, column 13 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING]

Solution found here:

https://stackoverflow.com/questions/37062491/maven-complaining-about-parent-relative-path

b) Building everything with jfastcgi-build worked, but when I chose single projects like for example client-core, I got errors like: [INFO] ------------------------------------------------------------------------ [INFO] Building jFastCGI Client: CORE 2.4-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ client-core --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ client-core --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /home/xxx/dev/git/jfastcgi/client/core/src/main/resources [INFO] [INFO] --- jrebel-maven-plugin:1.1.3:generate (generate-rebel-xml) @ client-core --- [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ client-core --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 17 source files to /home/xxx/dev/git/jfastcgi/client/core/target/classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] Source option 5 is no longer supported. Use 6 or later. [ERROR] Target option 1.5 is no longer supported. Use 1.6 or later. [INFO] 2 errors

c) INFO] ------------------------------------------------------------------------ [INFO] Building jFastCGI Client: CORE 2.4-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ client-core --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ client-core --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /home/xxx/dev/git/jfastcgi/client/core/src/main/resources [INFO] [INFO] --- jrebel-maven-plugin:1.1.3:generate (generate-rebel-xml) @ client-core --- [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ client-core --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 17 source files to /home/xxx/dev/git/jfastcgi/client/core/target/classes [WARNING] /home/xxx/dev/git/jfastcgi/client/core/src/main/java/org/jfastcgi/client/FastCGIHandlerFactory.java: Some input files use or override a deprecated API. [WARNING] /home/xxx/dev/git/jfastcgi/client/core/src/main/java/org/jfastcgi/client/FastCGIHandlerFactory.java: Recompile with -Xlint:deprecation for details. [INFO] [INFO] --- maven-checkstyle-plugin:2.10:check (verify-style) @ client-core --- [INFO] Downloading: http://repository.apache.org/snapshots/org/jfastcgi/parent/build-tools/2.4-SNAPSHOT/maven-metadata.xml [INFO] Downloading: http://repository.apache.org/snapshots/org/jfastcgi/parent/build-tools/2.4-SNAPSHOT/build-tools-2.4-SNAPSHOT.pom [WARNING] The POM for org.jfastcgi.parent:build-tools:jar:2.4-SNAPSHOT is missing, no dependency information available [INFO] Downloading: http://repository.apache.org/snapshots/org/jfastcgi/parent/build-tools/2.4-SNAPSHOT/build-tools-2.4-SNAPSHOT.jar [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] jFastCGI Client: CORE .............................. FAILURE [ 3.995 s] [INFO] jFastCGI Client: Servlet ........................... SKIPPED [INFO] jFastCGI Client: Portlet ........................... SKIPPED [INFO] jFastCGI Client: Spring-Integration ................ SKIPPED [INFO] jFastCGI Client: bundled ........................... SKIPPED [INFO] jFastCGI Client: Play!Framework 1.x ................ SKIPPED [INFO] jFastCGI Client: Parent ............................ SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.721 s [INFO] Finished at: 2018-05-24T15:05:17+02:00 [INFO] Final Memory: 18M/67M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.10:check (verify-style) on project client-core: Execution verify-style of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.10:check failed: Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.10 or one of its dependencies could not be resolved: Could not find artifact org.jfastcgi.parent:build-tools:jar:2.4-SNAPSHOT in apache.snapshots (http://repository.apache.org/snapshots) -> [Help 1]

In fact parent/build-tools is not used any more, just the checkstyle-default.xml from this directory is referenced. maven-checkstyle-plugin is configured following this instructions: http://maven.apache.org/plugins/maven-checkstyle-plugin/usage.html#Checking_for_Violations_as_Part_of_the_Build

2) CONTENT_TYPE The request header Content-Type is now forwarded.

3) More allowed headers Nextcloud also needs DESTINATION, OVERWRITE and X-REQUESTED-WITH request headers.

jrialland commented 6 years ago

Howdy, the build is ok on my side, thank you for your work

jm009 commented 6 years ago

Thank you. jfastcgi is very useful to me.

Another thing: I asked the travis-ci people, why maven always has to download that much libraries.

They answered:

Thanks for writing in and for sending your question along!

Every time a new build is triggered in Travis CI, we start a new virtualized environment to build your project, which is disposed of after each run. This is why the contents of the /.m2 folder are not automatically reused in your consecutive builds, since the new builds do no longer have access to those files.

However, this is something that can be solved with our Caching feature. It allows you to specify the directories that you'd like to keep cached for your builds, and once this is configured, Travis CI will take care of bringing these directories into your environment so that these are ready during build time.

The details of this Caching feature are available at: https://docs.travis-ci.com/user/caching, and we have also here a specific example related to Maven: https://docs.travis-ci.com/user/caching#Arbitrary-directories.

In short, and to activate this Caching feature to start caching your Maven dependencies, you'd need to add the following to your .travis.yml:

cache: directories:

  • $HOME/.m2

Would you like to give this a try and let us know if this helps?

Thank you, and have a great Friday!