Does anyone know if a list of known (and working) Maven Central Repository (http://repo1.maven.org/maven2) mirrors?
If not, what mirrors do you use when the central repository is down?
This is taken from #rvxnet's answer and an example of why link-only answer are not desirable. I've taken this from the 2015-05-20 WaybackMachine version of their link:
Official, but not browseable:
https://repo1.maven.org/maven2
Others:
https://maven.antelink.com/content/repositories/central/
Also, there are official instructions for configuring to use mirrors. Essentially, you add to you settings.xml the something like the following:
<mirrors>
<mirror>
<id>planetmirror.com</id>
<name>PlanetMirror Australia</name>
<url>http://downloads.planetmirror.com/pub/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
I just found this:
<mirrors>
<mirror>
<id>google-maven-central</id>
<name>Google Maven Central</name>
<url>https://maven-central.storage.googleapis.com/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
That worked great for me
credit: Failed to get the server archetype by maven
From Using Mirrors for Repositories:
The official Maven 2 repository is at:
http://repo.maven.apache.org/maven2 hosted in the US, or
http://uk.maven.org/maven2 hosted in the UK.
A list of known mirrors is available in the Repository Metadata. These mirrors may not have the same contents and we don't support them in any way.
Also:
The size of the central repository is increasing steadily. To save us bandwidth and you time, mirroring the entire central repository is not allowed (doing so will get you automatically banned). Instead, we suggest you setup a repository manager as a proxy.
Here https://repo.maven.apache.org/maven2/.meta/repository-metadata.xml you can see the following list:
<mirrors>
<!--mirror>
<id>cica.es</id>
<url>http://ftp.cica.es/mirrors/maven2</url>
</mirror-->
<mirror>
<id>repo.exist.com</id>
<url>http://repo.exist.com/maven2</url>
</mirror>
<mirror>
<id>ibiblio.org</id>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
</mirror>
<mirror>
<id>ibiblio.net</id>
<url>http://www.ibiblio.net/pub/packages/maven2</url>
</mirror>
<!--mirror>
<id>mirror.netcologne.de</id>
<url>http://mirror.netcologne.de/maven2</url>
</mirror -->
<mirror>
<id>uk.maven.org</id>
<url>http://uk.maven.org/maven2</url>
</mirror>
</mirrors>
This worked for me!
<mirror>
<id>central-secure</id>
<url>https://repo.maven.apache.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
Related
I am using Spring 2.0.1.RELEASE and have setup all projects (2 services and the cloud config server) with spring-cloud-bus
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
The config server also has the spring-cloud-config-monitor
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-monitor</artifactId>
</dependency>
I edit a file in my Git reposiroty (using local files with native profile of Spring Cloud Config). The change is detected, and I see the following line in the
Cloud Config Server:
17:59:25.201 [task-scheduler-3] INFO o.s.cloud.bus.event.RefreshListener - Received remote refresh request. Keys refreshed [version.client.min]
However, none of the other services receive the notification about updated keys.
On the other hand, if I manually call the bus-refresh endpoint of any other service, I see that all modules receive the updated key. The config server itself also receives the notification, but it says that there is no key updated, which makes sense since it already detected the change.
The documentation did not mention any special property to set apart from the RabbitMQ properties (which seem to be well configured since the bus-refresh endpoint is working as expected.)
I saw that there are already a few posts about this, one is even pointing to a bug that has been marked as resolved (https://github.com/spring-cloud/spring-cloud-bus/issues/101) but it does not seem to be working on my side.
Any property to enable for the config server to notify the bus?
Any hint regarding how to debug this?
Easy fix (after a lots of research!)
Changed all dependencies of org.springframework.cloud from FINCHLEY.M9 to 2.0.0.RC1 and suddenly, everything started working!
Perhaps your bootstrap.properties file aren't getting loaded on project startup
So a few things firsthand:
If you're using, (in your Cloud Config project),
<spring-cloud.version> 2020.0.0 (to be found under <DependencyManagement> or either specified in <properties>)
Then Spring Boot versions lower then 2.4.1 (in the same project) will not start up the cloud config server under its default dependencies.
So if you áre using the above versions, and maybe versions above,
Then for the projects that need updating by cloud Bus (using bootstrap.properties for instance) should contain the Starter Bootstrap dependency (of course along with the cloud-starter-config and the bus-amqp dependency)
<!-- Spring Cloud Config + Cloud Bus + Bootstrap-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
Plus check that the Spring cloud version is 2020.0.0-M6 or Hoxton.BUILD-SNAPSHOT depending on which Spring Boot version you're using. Here's a screenshot of which Spring Cloud versions are compatible with which Spring Boot versions
v v v v v v v
I m trying to encrypt my XMl with this call:
XMlCipher.martial(Document context,ReferenceList referenceList)
for this the Project is referencing the xmlsec-1.5.3.jar
I'm able to build and deploy the code successfully on weblogic server , but post execution I'm getting the below error in logs.
Caused by: java.lang.NoSuchMethodError:
org.apache.xml.security.encryption.XMLCipher.martial(Lorg/w3c/dom/Document;Lorg/apache/xml/security/encryption/ReferenceList;)Lorg/w3c/dom/Element;
at com.ally.util.encryption.EncryptionUtil.generateEncryptedXML(EncryptionUtil.java:381)
at com.ally.util.encryption.EncryptionUtil.getEnryptedXMLDocument(EncryptionUtil.java:443)
at com.ally.partner.fis.acctinq.FISSoapHandler.getFISEncryptedHeader(FISSoapHandler.java:154)
This kind of error is ALWAYS caused by having more than one reference of the XMlCipher on your classpath. It could be a duplicate xmlsec.jar or another instance of the XMlCipher in a different jar.
You have a few options to debug the problem:
Edit your war file to remove the duplicate jar and/or different version of the XMlCipher class
Connect to your weblogic managed server with jconsole and look at the classpath. See if you notice another instance of the xmlsec.jar being included
You may need to tell weblogic to prefer the instance of the class that lives within your .war/.ear file by specifying the following in your weblogic.xml:
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.apache.xml.security.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
See the docs for more details and similar questions like: Weblogic 10.3.1.0 is using com.bea.core.apache.commons.net_1.0.0.0_1-4-1.jar... I want to use commons-net-2.0.jar from my code
I realize you didn't mention the use of Maven or SoapUI, but I was receiving a similar exception (java.lang.NoSuchMethodError: org.apache.xml.security.encryption.XMLCipher.setSecureValidation) when attempting to use the soapui-maven-plugin and wanted to post my solution to hopefully help.
The fix for me was to add an xml-security dependency to the soapui-maven-plugin inside the pom.xml like so:
<!-- To run, enter this command from the module directory: mvn soapui:test -->
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.1.1</version>
<dependencies>
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>1.5.2</version>
</dependency>
</dependencies>
<configuration>
<projectFile>src/test/soap-ui/your-soapui-xml-file.xml</projectFile>
</configuration>
</plugin>
</plugins>
In my case, I didn't have an xml security dependency anywhere else in my project.
In other cases, it seems like some may be experiencing this error due to having multiple xml security dependencies throughout their project (and they are conflicting, like one answer is already alluding to). So, if the above fix doesn't work for you in that scenario, you may need to look into which dependencies in your project are including xml security and deciding which one you want to include and which one you want to exclude (e.g. using Maven's exclusion or provided scope markings in the given pom).
Running version 3.2 I am getting an error
[WARN] liquibase - schema_reference.4: Failed to read schema document 'http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not .
When I look for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd it is not there, although http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd is.
I came accross this https://liquibase.jira.com/browse/CORE-1840, which I interpret to say you dont need access to the internet to get dbchangelog-3.2.xsd. It doesnt seem to help when the internet is available but the .xsd is not there.
I have reverted back to 3.1 but would like to know the root cause of my 3.2 problem.
Updating the liquibase version to the latest solved my problem
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.6.3</version>
</dependency>
I solved it by distributing the schema with my application and referring to it locally (relative path). In the example below I have the schema file in the same folder as the changelog.
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog-3.1.xsd">
<!-- all the things -->
</databaseChangeLog>
Liquibase does not looking for xsd in Internet. http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd will be replaced to path to java recources
More detailed info can be find here
I fixed the issue following what found here.
The solution works only for the one using maven-liquibase-plugin.
You have to run liquibase migration with the following option -Dprefer.internal.xsd=true:
mvn -Dprefer.internal.xsd=true liquibase:update
Check your changlog.xml file headers having xsd document version.
If it doesn't match it will during spring boot:run
I'm using Maven 3.0.3. Is there a way I can use the Maven Cargo plugin to spin up an embedded Tomcat server? Right now, it seems I have to install it myself first. I get this error when I try and change the container type to "embedded" ...
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.1.2:run (default-cli) on project jx: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.1.2:run failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [tomcat6x], type = [embedded]], configuration type [standalone]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]
The configuration that I used was ...
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<type>embedded</type>
</container>
<configuration>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.logging>high</cargo.logging>
</properties>
Any help is appreciated. The reason I'm not using the Maven embedded Tomcat plugin is that it doesn't support multiple deployment artifacts. Thanks, - Dave
From cargo documentation Embedded Container is not supported on tomcat6. It is only supported for jetty.
Maybe the t7mp Plugin would be an alternative? The Overview of the configuration options shows how to deploy multiple webapps and how to configure shared libs. As far as I know the current version is not available in maven central so you would have to download it from github and build and deploy it yourself.
When running it populates the target/tomcat folder with the libs of a specified tomcat 6 or 7 version and bootstrap tomcat using a new classloader in the same jvm.
I have a profile in my pom.xml which should be always active unless it is explicitely deactivated (-P !firstProfile).
I solved this by using the activeByDefault flag:
<profiles>
<profile>
<id>firstProfile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
...
</profile>
</profiles>
Now in the same pom.xml I have a second profile defined this should only be active if the profile is really activated (-P secondProfile).
So the default behaviour is: firstProfile active, secondProfile inactive.
At some other point I would like to activated the second profile in addition to the first profile.
Now the problem is that if I do that with "-P secondProfile" the firstProfile unfortunately gets deactivated.
The Maven documentation states this:
...
This profile will automatically be
active for all builds unless another
profile in the same POM is activated
using one of the previously described
methods. All profiles that are active
by default are automatically
deactivated when a profile in the POM
is activated on the command line or
through its activation config.
...
Is there somehow a possibility how to keep the firstProfile always active (without having to declare it in the settings.xml)?
One trick is to avoid activeByDefault, and instead activate the profile by the absence of a property, eg:
<profiles>
<profile>
<id>firstProfile</id>
<activation>
<property>
<name>!skipFirstProfile</name>
</property>
</activation>
...
</profile>
</profiles>
You should then be able to deactivate the profile with -DskipFirstProfile
or with -P !firstProfile, but otherwise the profile will be active.
See: Maven: The Complete Reference, Profile Activation - Activation by the Absence of a Property
I wish there was such a possibility, I have often missed it. The only relevant JIRA issue I could find is this one:
MNG-4917: Profile not active even though it has activeByDefault set to true
And it's been resolved as Not A Problem.
I've stopped using activeByDefault, because this "all or nothing" approach made it worthless for me.
The only way to change this behavior is to write your own replacement for DefaultProfileSelector, register it as a plexus component with #Component( role = ProfileSelector.class ) and put it in ${MAVEN_HOME}/lib/ext (that way it will be picked as default profile selector). (If you are using Maven 3.0.2 or older you will also have to edit ${MAVEN_HOME}/bin/m2.conf to load lib/ext before it loads lib)
This question is ancient, but it appears the problem is solvable by using activeProfile rather than activeByDefault. I'm on Maven 3.3.9, but the solution may work on earlier versions.
Simply list out your activeProfiles in your settings.xml, like so:
<settings>
<profiles>
[...]
</profiles>
<activeProfiles>
<activeProfile>my-awesome-profile</activeProfile>
</activeProfiles>
</settings>
In my-awesome-profile I have settings like database URLs and so on, so they always apply. Here, I activate a second profile, resolve-from-central:
$ mvn help:all-profiles -P resolve-from-central
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-help-plugin:2.2:all-profiles (default-cli) # standalone-pom ---
[INFO] Listing Profiles for Project: org.apache.maven:standalone-pom:pom:1
Profile Id: resolve-from-central (Active: true , Source: settings.xml)
Profile Id: my-awesome-profile (Active: true , Source: settings.xml)
Profile Id: resolve-from-internal (Active: false , Source: settings.xml)
Notice how my-awesome-profile is still active. Yay!
Profiles are a good way to bring some order into POM.
Especially if you use multiple executions of the same plugin for different purposes.
Using files:
<profile>
<id>alwaysActive</id>
<activation>
<file><exists>.</exists></file>
</activation>
...
</profile>
This will always be true (unless someone deletes the directory during Maven boot :). Tested with Maven 3.6.0.
It might also be a good way to differentiate between types of projects. For instance, my project has always module.json present.
Using a profile activating extension
There are a few Maven extensions for profile activation. One of them in a fork here:
https://github.com/OndraZizka/el-profile-activator-extension
You can simply list all the profiles you want activated on the command line as such:
-P profile-1,profile-2
maven was designed to allow multiple profile activation automatically, if you however override that with the -P then only the profiles listed in the parameter are activated.
You can't keep the default profile active, but you can take the contents of that profile (the ... in your example) and just move it to the main section of the pom.
Just because you are using profiles, it does not mean everything you are doing needs to be within a profile.