Is there any way to specify a number of OBR repositories in Felix's config.properties file? I do can add a repository at runtime, but I have to do it after restart.
"Prefrences Service" does not help, it seems "Bundle Repository" does not use it.
conf/config.properties
obr.repository.url=(space delimited list of urls)
What you can do is :
Set a default repository(Felix property). I don't think that you can use commas but you could try.
Add a list of repositories at runtime(You could store them in a db and repopulate/register the list dynamically at each startup). If you just need to query the repository service and update the repository list in an activator for example.
Related
I know that I can use either of the two options below to resolve serverless variables with values from .env.{stage} files.
https://www.serverless.com/plugins/serverless-dotenv-plugin
https://www.serverless.com/framework/docs/environment-variables/
But how would I do if I need my env file to also be per region, e.g. .env.{stage}.{region}?
Unfortunately it's simply not supported by both of those. Consider creating a PR to add this feature to the plugin or Serverless Framework itself.
I believe adding it to Serverless Framework would be great, as this feature is really useful and also the plugin might be abandoned soon, since Serverless Framework provides almost the same features with native useDotEnv: true switch.
If you need this feature quickly, you could always clone the plugin repository, add the feature and then use the plugin from your own copy. You can find out more details in the documentation (search for ./):
https://www.serverless.com/framework/docs/providers/aws/guide/plugins
Could you name each .env file a combination of env+region, and then use that?
Ex:
us-east-1.dev.env
us-east-1.prod.env
...
Then you could deploy with
NODE_ENV=us-east-1.prod, which would give you region + env specific dotenv files.
I am currently writing a program with intellijea IDEA. I cloned my gitlab project. However, when I try to create new class, I don't get to see the option to create new class. Please what I am doing wrong? Or is there a better way to resolve this issue?
you need to define the content type of a directory. This way IntelliJ can provide context aware menu options for you.
First create a directory. E.g. src/main/java (like maven).
You can set this in the module settings:
Tip: If you use maven or another build tool, you can add support for that tool to your project too.
I have a savant repository in my project and I want to add all of the jars contained within the repo to IntelliJ's depenedcies list. I can add the jars one at a time, but I want to be able to add them all at once.
Is there a way to add all the jars found within all the directories/subdirectories?
Details: IntelliJ 12
Update: I can not change the repository structure, it is auto populated when ant builds.
Adding jars from a directory is supported, but not recursively, please vote for this feature request.
Yes, you can add all jars in a folder.
You have to create a library and select option: "Attach file or directories" and the select a directory.
This way even a future changes to the directory will be visible.
In general, what is the best strategy for finding the groupId and artifactId for a well-known dependency for use in a Maven POM? For example, how would I find the correct entry for the MySQL JDBC driver? It's not mentioned on the mysql.com site, so I would usually spend time looking for another POM that already uses the Maven repository version of the jar. This can't be the best way.
I would suggest to use http://search.maven.org
M2Eclipse, the maven integration of eclipse, supports local searchable indexes of maven repositories. So you can right-click a project or a pom.xml and do
Maven -> Add Dependency
A dialog appears where you can search for artifacts from your local indexes. Wouldn't want to miss it.
If that's not an option, use mvnrepository.com
Most of the time my IDE does this for me. But when I'm not sure I search manually; Google really helps.
You can also search on maven search engines like this mvnrepository.com.
I use http://repository.sonatype.org.
Maven site suggests to browse biblio to get maven co-ordinates; http://www.ibiblio.org/ .
Say for log4j
First, we need to know what the groupId, artifactId, and version are for log4j. We can browse ibiblio and look for it, or use Google to help by searching for "site:www.ibiblio.org maven2 log4j".
Maven metadata for log4j: http://mirrors.ibiblio.org/maven2/log4j/log4j/maven-metadata.xml
In my experience the best option is mvnrepository.com. for example in your case, just type mysql in the search text field. you will find all available artifacts that contain mysql string. in your case the one fit your needs is: mysql-connector-java
for each artifact you have a general description that helps you decide what is best for you.
once you click it you get all the available versions and once you click on a version you have all sort of information about it like the code you need to add to your pom.xml, the artifact dependencies and so on...
1. Go to http://search.maven.org
2. Search in the required jar with groupId/artifactId or Just with basic text.
Like for your case
I've asked a similar question in which part of this was addressed, but I'd like to expand in more detail.
When configuring maven to look at internal repositories, is it best to put that information in the project pom or in a user's settings.xml? An explanation on why would be really helpful here.
thanks,
Jeff
You should always try to make the maven project so that it compiles from a clean checkout from source control in your local environment; without a settings.xml. In my opinion this means that you place any overrides to sensible default values in the user's settings.xml file. But the pom should contain sensible values that will work for everyone.
I encourage you to put the repository definition in the POM, this way any developer just grab a copy of the code and run Maven to get it compiled, without having to change things in his settings file.
I find the setting.xml file useful just for hacking Maven's behaviour in special situations, for example when one repository is not accessible due to a firewall and you need to use a mirror. But that's my personal opinion. Maven documentation gives you more freedom:
The settings element in the
settings.xml file contains elements
used to define values which configure
Maven execution in various ways, like
the pom.xml, but should not be bundled
to any specific project, or
distributed to an audience. These
include values such as the local
repository location, alternate remote
repository servers, and authentication
information.
If you have a local repository which is used in every single project you may add that at the settings.xml, just be sure that configuration is well documented, in my current project it's not and new developers struggle at the beginning when they try to compile something.
We use the user's settings.xml and include info in the README about what possible other repos may be needed.
In theory a given group-artifact-version is the same no matter which repo it comes from. It works pretty well for us. If you find yourself with two different assets that have the same group-artifact-version identifier, then that indicates you're doing something really bad.