Comments (5)
@deweyjose Juggling Maven profiles can be a pain in the neck. Most popular Maven plugins seem to end up with a skip
option eventually, probably because it's such a pain otherwise.
skip
is just generally useful, but two cases have come up recently:
- Configure the plugin at the top level of a multi-module project, but configure it to skip in all the modules except one. This allows invoking the plugin from the top level (and using the short invocation which omits the
groupId
) without running it against modules where it makes no sense. - In a CI situation, I may need to run parts of the Maven lifecycle again in a different stage of the pipeline. If the code has already been generated, it's nice to have the option to skip unnecessary code generation easily. With this feature, adding
-Ddgs.codegen.skip
is a small change which doesn't affect the pom. Without a built-in skip feature, achieving the same thing with a Maven profile (activated by the absence of a command line property) will require changes to at least one pom, and several lines of XML. This could also be achieved with the environment variable you suggest, but I think-Ddgs.codegen.skip
is more readable thanDGSPHASE=none
, especially if you need to skip multiple plugins.
from graphqlcodegen.
Thanks @deweyjose and @zorglube!
from graphqlcodegen.
Here it is Add Skip Option PR, know we're waiting for @deweyjose to merge it.
By the time you can build the plugin on you side (mvn install
) to get the option eralier.
from graphqlcodegen.
Hi @seanf I'd like to learn a little more about this use-case first.
Why invoke the codegen plugin at all in this case? Have you taken a look at ways to achieve this with maven profiles - different plugins enabled for different profiles?
Another option could be to use environment variables:
<plugin>
<groupId>io.github.deweyjose</groupId>
<artifactId>graphqlcodegen-maven-plugin</artifactId>
<version>1.15</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<phase>${env.DGSPHASE}</phase>
</execution>
</executions>
</plugin>
The plugin will run:
export DGSPHASE=generate-sources; mvn clean install
The plugin will not run:
export DGSPHASE=none; mvn clean install
from graphqlcodegen.
@deweyjose definitly the solution you purposed work to enable/disable codegen. However, I have a preference for the -Ddgs.codegen.skip=true
option.
That's my point of view.
from graphqlcodegen.
Related Issues (20)
- schemaPaths multiple files HOT 1
- Projection classes generate invalid constructors HOT 4
- Is there a way to distinguish explicit null values from missing values? HOT 2
- generateJava code for client when generateClient is true HOT 1
- Maintainer HOT 7
- generateClient Fails when Query isn't named Query HOT 7
- Plugin delete existing files in <outputDir> HOT 1
- Exclude generated files from code coverage report HOT 6
- Add `maven-release-plugin` HOT 1
- Not able to generate builder classes in Kotlin HOT 2
- Please add a LICENSE file HOT 1
- Fix documentation
- Plugin not generating query client classes
- Include Class Imports and custom annoations HOT 1
- Support for 6.0.1 HOT 1
- Provide a way to pass Java Generic Class as an argument to <typeMapping> HOT 2
- Multiple issues when trying to get a schema from a dependency HOT 2
- integration with codegen and relay pagination HOT 1
- What is the difference between graphql-dgs-codegen-core and graphql-dgs-codegen-client-core? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphqlcodegen.