0
votes

I am not super confident in my understanding of Maven so bear with me:

My POM:

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>org.springframework.transaction</artifactId>
  <version>3.2.4.RELEASE</version>
</dependency>

Build:

[WARNING] The POM for org.springframework:org.springframework.transaction:jar:3.2.4.RELEASE is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.427 s
[INFO] Finished at: 2016-12-02T15:22:42-08:00
[INFO] Final Memory: 7M/77M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project PROJECT: Could not resolve dependencies for project PROJECT:jar:1.0: Failure to find org.springframework:org.springframework.transaction:jar:3.2.4.RELEASE in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of maven2 has elapsed or updates are forced -> [Help 1]

Looking in http://repo1.maven.org/maven2 this makes sense. org.springframework.transaction is indeed not present in the repository. So I went to this page and noticed that it says the artifact lives in the following repository:

https://artifacts.alfresco.com/nexus/content/repositories/public/

This time, looking through the repository I did find org.springframework.transaction at the directory matching the groupId and artifactId specified in my POM.

https://artifacts.alfresco.com/nexus/content/repositories/public/org/springframework/org.springframework.transaction/

However there is clearly no 3.2.4.RELEASE here. My co-worker's are able to build the project (though it has been some time since they checked it out fresh) and they remember running into a similar issue. I am a little confused as to why this feels like a repository issue though when we are all running the same POM.

As an aside, there are multiple other org.springframework dependencies that are resolving appropriately and I can see them in my ~/.m2, just not this one.

4

4 Answers

1
votes

The org.springframework.transaction has the spring-tx artifact id.

I use this snippet in my pom and works seamlessly:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-tx</artifactId>
    <version>3.2.4.RElEASE</version>
</dependency>
0
votes

As @Vadim just answered, you just need to add your custom repo to your pom.

<repositories>
    <repository>
      <id>alfresco</id>
      <name>your custom repo</name>
         <url>http://repository.springsource.com/maven/bundles/releas‌​e</url>
    </repository>
</repositories>

And then you can get your dependency by using:

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>org.springframework.transaction</artifactId>
  <version>3.2.4.RELEASE</version>
</dependency>

You can view the repository contents by using this link https://artifacts.alfresco.com/nexus/#nexus-search;quick~transaction

Also be carefull not to run maven with -o flag( or in offline mode ) for the first time in order to let maven to download the dependency.

0
votes

Ended up being an issue to having spring-context dependency in my pom. Apparently that does stuff for you? Getting rid of both spring-tx and org.springframework.transaction actually allowed them to be downloaded and accessed properly.

0
votes

Your .m2 does not have it and Maven tries to get it from defined repositories. You do not have them or you do not have a connection from Maven. (it is more likely from what error says as I remember). are you behind the proxy?

You need to define additional repositories. either in ~/.m2/settings.xml or inside POM on project level.

Something like that:

<repositories>
   <repository>
                <id>fuse-public-repository</id>
                <name>FuseSource Community Release Repository</name>                            
                 <url>https://repo.fusesource.com/nexus/content/groups/public</url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                    <updatePolicy>never</updatePolicy>
                </snapshots>
            </repository>
 <repositories>

in settings.xml usually in one of the active profile element. In POM just inside project.

PS. be sure you have connection to the repository URL. If you are behind proxy you need to define it as well in settings.xml