Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I've always wondered what these are. I've read the Maven documentation about this and I don't think I really understand it. Could somebody please explain this? Thanks.
Optional dependencies are used when it's not really possible (for whatever reason) to split a project up into sub-modules. The idea is that some of the dependencies are only used for certain features in the project, and will not be needed if that feature isn't used. Ideally, such a feature would be split into a sub-module that depended on the core functionality project...this new subproject would have only non-optional dependencies, since you'd need them all if you decided to use the subproject's functionality.
However, since the project cannot be split up (again, for whatever reason), these dependencies are declared optional. If a user wants to use functionality related to an optional dependency, they will have to redeclare that optional dependency in their own project. This is not the most clear way to handle this situation, but then again both optional dependencies and dependency exclusions are stop-gap solutions.
Reference: http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am working on a new Golang application which involves some proprietary code and also includes some open sources packages. The code will be part of an enterprise GitHub repository.
We don't plan to keep using the latest versions of the open source packages and would want to keep a stable version of the packages. In this context what is the best way to organize the code? From what I have read so far the best way to put the opensource packages into the Vendors directory.
In any case, a clear project layout is something we want to have in the beginning to keep things simple in the long run.
If you are using a version of Go < 1.11, you can take a look at dep for dependency management :
a dep init will generate the layout (see Creating a New Project)
a Gopkg.lock file will handle specific revisions for each dependency, thus ensuring the stability of your build (instead of having different developers using different versions of the same dependency, depending on when they go get that dependency).
However, if you are using a version of Go >= 1.11, as #oren points out in the comments section (credits to him), you'd probably want to use Go modules instead, as it is now introduced in the Go tool chain.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I was wondering if there was a way to fail a maven build based on the return of a script. I did not find any useful resources on the web.
Use case:
We have a lot of configurations files. I want to check the files for the required properties, if they all have them -> continue build, if they don't -> fail build. Is this possible with a simple bash script?
Thanks in advance!
Is that a Maven project? Then check the property files with unit tests.
I'm using unit tests for all kinds of "convention" tests; that's those things where everyone "assumes" that "something is so."
I usually check:
Are all mandatory config options defined?
Does the code access config options which don't exist?
When production bugs come in, where clients make config mistakes, I add tests to make sure they get a good error message in the future
How do I check access to config options? I put each config option name into a constant and then use reflection to collect them all. I do the same with all the options in property files and then compare the two lists.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have been working configuring a number of projects for use with Maven.
Most projects contains multiple modules (POMs) and these are all based on a few POMs I pulled from another project.
While the structure is generally fine, there are a number of redundant elements included in some files.
Is there a tool that I can use to scan for elements that are duplicates, not ever referenced, should be moved up a level etc.
I have been looking at Maven POM Lint Plugin, which looks like it might do the job. Is there anything else I should be considering?
Maven POM Lint Plugin can help you a bit in maintaining your POMs to be clean and short. For me however, what is usually far more important, is to manage declared dependencies right. I like to have only those dependencies declared that are really used and also I like to explicitly depend on what I use without getting stuff transitively. For these things I recommend Maven Dependency Plugin with its dependency:analyze goal.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Is there any way to do analysis of 3rd party java library jars.
There huge set of jars being used by application of obsolete version but stable.
Is there any way to find out report which shows what are my repository version is and what is market latest jars...
I just don't want to keep version as latest and product stability is a very important factor.
Going through each and every jar and do research is really cumbersome.
Is there any better method ?
You can use versions plugin.
mvn versions:display-dependency-updates
This will scan a project's dependencies and produces a report of those dependencies which have newer versions available.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Is there a standard way for finding maven entries for any project? For eg if I talk about Spring MVC. Do I need to go the Spring website and find a section there or is there some other standard procedure using which I can find the entries I need to make ?
No, You can find them in the ordinary maven repositories:
http://mvnrepository.com/
http://search.maven.org/
You search for the artificat you want, and get the pom info to include in your dependencies
I just google "maven" and the package name. Some artifacts are only made public in company repos.
I search com.x.y.z maven coordinates on google and almost every time I get the results.