Category Archives: archiva

How to upload Jar to Archiva without having the Version number appended?

If I use the UI Console to add a jar file to our Apache Archiva Maven Repo the version number is added to the jar file, but that's not what we want. For example if you browse http://mvnrepository.com/ to get a jar to download the version is a sub folder and not attached to the jar file name.

As you can see below I'm trying to add a 3rd party Jar to the repo via the UI but the version gets attached to the name.

Collection: /com/microsoft/sqlserver/jdbc/sqljdbc41/4.1.5605.100
com/microsoft/sqlserver/jdbc/sqljdbc41 (Parent)


Name

Size (Bytes)

Last Modified

maven-metadata.xml 184   12/08/16 11:30 
maven-metadata.xml.md5 52   12/08/16 11:04 
maven-metadata.xml.sha1 60   12/08/16 11:04 
sqljdbc41-4.1.5605.100.jar 586192   12/08/16 11:04 
sqljdbc41-4.1.5605.100.jar.md5 60   12/08/16 11:04 
sqljdbc41-4.1.5605.100.jar.sha1 68   12/08/16 11:04 
sqljdbc41-4.1.5605.100.pom 417   12/08/16 11:04 
sqljdbc41-4.1.5605.100.pom.md5 60   12/08/16 11:04 
sqljdbc41-4.1.5605.100.pom.sha1 68   12/08/16 11:04 

Much obliged for any help. Mike

Apache archiva returns http error 503

I am using apache Archiva v. 2.2.0 under Windows Server 2012 R2, Java version 1.8.0_60 inside VirtualBox. It used to work for quite a long time before Windows autoupdate.

After Windows autoupdate I am getting an error message when going to archiva url: HTTP ERROR: 503 . Problem accessing /. Reason: Service Unavailable, Powered by Jetty://.

The Apache Archiva service is running. No error logs are generated. Restarting or even reinstalling of the service has no impact.

After rolling back of Windows update I restore the normal operation of Archiva, but mysteriously, just once, i.e. stopping and restarting of Archiva will cause the same HTTP ERROR 503.

The log file do not indicate any problem or error cuase.

Thank you for any tips.

Archiva Remote repository issue

I am trying to add a remote repository on Archiva. However, I keep getting this error in the logs:

ERROR org.apache.cxf.jaxrs.utils.JAXRSUtils []
- No message body writer has been found for class org.apache.archiva.rest.services.ArchivaRestError,
ContentType: text/plain

I tried adding the Content Type header with text/plain but that did not work

Why did Apache Archiva never "go anywhere"?

It seems like a free, artifact storage application with a nice GUI for jars, wars, rpms, etc. is really needed given that SVN is a bit old and Artifactory and Nexus (can be) are quite expensive. So I am confused as to why Apache Archiva never really went anywhere? I know the main engineer just released a new version just before the time of this writing and I am grateful for his time and effort. Nonetheless, it seems like this product never really caught on for build and devops teams even though it should have...

unable to fetch index from Apache Archiva

My IDE (Netbeans) fails every time it tries to get the index form Archiva. I know that Archiva und the local maven configuration is generally working because I can compile my projects and fetch the artifacts without any problems. It's just not possible to get the index. This is the message in the IDE log:

org.apache.maven.wagon.ResourceDoesNotExistException: File: http://archiva/repository/internal/.index/nexus-maven-repository-index.properties , ReasonPhrase:Not a valid request path layout, too short..
...
Caused: java.io.FileNotFoundException: Resource nexus-maven-repository-index.properties does not exist

When I open the URL in a browser then I get this message:

HTTP ERROR 404
Problem accessing /repository/internal/.index/nexus-maven-repository-index.properties. Reason:
Not a valid request path layout, too short.

The fact that I'm using Netbeans should actually not be important here.

I've spotted that the index file indeed exists on the archiva server in this path: ./repositories/repositories/internal/repositories/internal/.index/nexus-maven-repository-index.properties

Configuring Apache Archiva on Glassfish 4.1

I've deployed Archiva 2.2.0 on Glassfish 4.1.1 however something about the configuration is puzzling me.

I've followed the Glassfish specific guide here. and modified the domain.xml but I expected the embedded database (within Archiva WAR) to be used however it is not. In when I enable the Archiva war it fails with the error:

java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskExecutor#indexing': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin org.apache.archiva.scheduler.indexing.ArchivaIndexingTaskExecutor.managedRepositoryAdmin; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'managedRepositoryAdmin#default': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.apache.archiva.redback.role.RoleManager org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin.roleManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'roleManager': Invocation of init method failed; nested exception is javax.jdo.JDODataStoreException: Failed initialising database. Please check that your database JDBC driver is accessible, and the database URL and username/password are correct. Exception : Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused. java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.

Basically I understand this to mean there is no database connection available however as I've configure domain.xml to use an embedded database I don't understand why I get this error.

The only way I get it to work is by starting the default database within Glassfish with the asadmin command start-database. Then archiva deploys but it uses the database sun-appserv-samples which is defined by default in domain.xml (see below)

The following is the relevant part of domain.xml

<resources>
<jdbc-resource pool-name="__TimerPool" object-type="system-admin" jndi-name="jdbc/__TimerPool"></jdbc-resource>
<jdbc-resource pool-name="DerbyPool" object-type="system-all" jndi-name="jdbc/__default"></jdbc-resource>
<jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" name="__TimerPool" res-type="javax.sql.XADataSource">
  <property name="databaseName" value="${com.sun.aas.instanceRoot}/lib/databases/ejbtimer"></property>
  <property name="connectionAttributes" value=";create=true"></property>
</jdbc-connection-pool>
<jdbc-connection-pool is-isolation-level-guaranteed="false" datasource-classname="org.apache.derby.jdbc.ClientDataSource" name="DerbyPool" res-type="javax.sql.DataSource">
  <property name="PortNumber" value="1527"></property>
  <property name="Password" value="APP"></property>
  <property name="User" value="APP"></property>
  <property name="serverName" value="localhost"></property>
  <property name="DatabaseName" value="sun-appserv-samples"></property>
  <property name="connectionAttributes" value=";create=true"></property>
</jdbc-connection-pool>
<connector-connection-pool max-pool-size="250" resource-adapter-name="jmsra" steady-pool-size="1" name="jms/__defaultConnectionFactory-Connection-Pool" connection-definition-name="javax.jms.ConnectionFactory"></connector-connection-pool>
<connector-resource pool-name="jms/__defaultConnectionFactory-Connection-Pool" object-type="system-all-req" jndi-name="jms/__defaultConnectionFactory"></connector-resource>
<context-service object-type="system-all" jndi-name="concurrent/__defaultContextService"></context-service>
<managed-executor-service object-type="system-all" jndi-name="concurrent/__defaultManagedExecutorService"></managed-executor-service>
<managed-scheduled-executor-service object-type="system-all" jndi-name="concurrent/__defaultManagedScheduledExecutorService"></managed-scheduled-executor-service>
<managed-thread-factory object-type="system-all" jndi-name="concurrent/__defaultManagedThreadFactory"></managed-thread-factory>
<jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" name="archivaUsersPool" res-type="javax.sql.XADataSource">
  <property name="databaseName" value="${com.sun.aas.instanceRoot}/lib/databases/archivausers"></property>
  <property name="connectionAttributes" value=";create=true"></property>
</jdbc-connection-pool>
<jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" name="archivaPool" res-type="javax.sql.XADataSource">
  <property name="databaseName" value="${com.sun.aas.instanceRoot}/lib/databases/archivapool"></property>
  <property name="connectionAttributes" value=";create=true"></property>
</jdbc-connection-pool>
<jdbc-resource pool-name="archivaUsersPool" jndi-name="jdbc/users"></jdbc-resource>
<jdbc-resource pool-name="archivaPool" jndi-name="jdbc/archiva"></jdbc-resource>
<mail-resource host="email.example.com" from="[email protected]" user="me" jndi-name="mail/Session"></mail-resource>

So my questions are:

  1. How can I get Archiva to work with an embedded database, I don't want to use the Glassfish one.
  2. Why when it cannot use the embedded database use anyone it can 'get a hold of'. Surely this is incorrect behaviour? There is nothing in domain.xml to link Archiva to the sun-appserv-samples database?
  3. Are the modifications I made to domain.xml correct?

Apache Archiva unable to resolve POM

I am attempting to set up an Apache Archiva 2.2.0 instance for our internal repository manager and have run into the following problem when deploying artifacts to the repository:

 2015-12-09 15:04:33,329 [qtp1546882461-25] WARN  
 org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage []
 - The artifact's parent POM file 'xxx.xxx' cannot be resolved. Using defaults for project version metadata..

This message appears when attempting to upload the artifact xxx.xxx, and happens both on my local vanilla Archiva instance using the internal repository as well as on our corporate Archiva instance which is configured with custom repositories.

This causes the artifact info to be very basic and when the artifact is not a jar, even inaccurate. However, artifacts downloaded from remote repositories show all of the correct details.

Any thoughts as to why this is happening and how to fix it?

Apache Archiva unable to resolve POM

I am attempting to set up an Apache Archiva 2.2.0 instance for our internal repository manager and have run into the following problem when deploying artifacts to the repository:

 2015-12-09 15:04:33,329 [qtp1546882461-25] WARN  
 org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage []
 - The artifact's parent POM file 'xxx.xxx' cannot be resolved. Using defaults for project version metadata..

This message appears when attempting to upload the artifact xxx.xxx, and happens both on my local vanilla Archiva instance using the internal repository as well as on our corporate Archiva instance which is configured with custom repositories.

This causes the artifact info to be very basic and when the artifact is not a jar, even inaccurate. However, artifacts downloaded from remote repositories show all of the correct details.

Any thoughts as to why this is happening and how to fix it?

Apache Archiva unable to resolve POM

I am attempting to set up an Apache Archiva 2.2.0 instance for our internal repository manager and have run into the following problem when deploying artifacts to the repository:

 2015-12-09 15:04:33,329 [qtp1546882461-25] WARN  
 org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage []
 - The artifact's parent POM file 'xxx.xxx' cannot be resolved. Using defaults for project version metadata..

This message appears when attempting to upload the artifact xxx.xxx, and happens both on my local vanilla Archiva instance using the internal repository as well as on our corporate Archiva instance which is configured with custom repositories.

This causes the artifact info to be very basic and when the artifact is not a jar, even inaccurate. However, artifacts downloaded from remote repositories show all of the correct details.

Any thoughts as to why this is happening and how to fix it?

Apache Archiva unable to resolve POM

I am attempting to set up an Apache Archiva 2.2.0 instance for our internal repository manager and have run into the following problem when deploying artifacts to the repository:

 2015-12-09 15:04:33,329 [qtp1546882461-25] WARN  
 org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage []
 - The artifact's parent POM file 'xxx.xxx' cannot be resolved. Using defaults for project version metadata..

This message appears when attempting to upload the artifact xxx.xxx, and happens both on my local vanilla Archiva instance using the internal repository as well as on our corporate Archiva instance which is configured with custom repositories.

This causes the artifact info to be very basic and when the artifact is not a jar, even inaccurate. However, artifacts downloaded from remote repositories show all of the correct details.

Any thoughts as to why this is happening and how to fix it?